POST Token
Obtain a logon token. Any subsequent request to use password protected resources can then include the returned access_token in the headers; specifically the HTTPS header should contain an Authorization field that equals “Bearer ”+ access_token.
Request Information
URI Parameters
None.
Body Parameters
JSON object containing the logon information
Name | Description | Type | Additional information |
---|---|---|---|
grant_type |
The type of logon request, for example 'password' |
string |
Required |
username |
The email address associated with the account. |
string |
Required |
password |
The login password |
string |
Required Data type: Password |
Request Formats
application/json, text/json
{ "grant_type": "password", "username": "yourname@somewhere.com", "password": "abcdefg" }
application/xml, text/xml
<LoginModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PalmSmart.Models"> <grant_type>password</grant_type> <username>yourname@somewhere.com</username> <password>abcdefg</password> </LoginModel>
Response Information
Resource Description
Object containing the login information
Name | Description | Type | Additional information |
---|---|---|---|
userName |
The email address of the logged in user. |
string |
None. |
token_type | string |
None. |
|
access_token |
The actual access token that can be included in the HTTPS header for endpoints that require authorization. |
string |
None. |
.issued |
The date and time the token was issued |
string |
None. |
.expired |
The date and time the token will expire |
string |
None. |
.persistent |
|
string |
None. |
expires_in |
|
integer number |
None. |
Response Formats
application/json, text/json
{ "userName": "yourName@somewhere.com", "token_type": "bearer", "access_token": "abcdefghi....", ".issued": "Fri 22 Jan 2016 05:00:00 GMT" ".expires": "Fri 05 Feb 2016 05:00:00 GMT" ".persistent": "" "expires_in": 1234567 }
application/xml, text/xml
<TokenData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PalmSmart.Models"> <userName>yourname@somewhere.com</userName> <token_type>bearer</token_type> <access_token>abcdefghi....</access_token> <.issued>Fri 22 Jan 2016 05:00:00 GMT</.issued> <.expires>Fri 05 Feb 2016 05:00:00 GMT</.expires> <.persistent></.persistent> <expires_in>12345567</expires_in> </TokenData>