POST token
V2 - The /token endpoint is used to log a user into the system.
Contrary to most methods in this API, this method does not expect JSON in the request body.
Instead it expects the parameters in application/x-www-form-urlencoded format:
grant_type=password&username=theuser&password=thepass
Request Information
URI Parameters
None.
Body Parameters
OAuthRequest| Name | Description | Type | Additional information |
|---|---|---|---|
| grant_type |
The grant type. Currently only the grant type password is supported. |
string |
Required |
| userName |
The username for this login request. |
string |
Required |
| password |
The password for this user. |
string |
Required Data type: Password |
| clientKey |
A key used to link the new session to a specific device. |
string |
None. |
Request Formats
application/json, text/json
{
"grant_type": "sample string 1",
"userName": "sample string 2",
"password": "sample string 3",
"clientKey": "sample string 4"
}
text/javascript
{"grant_type":"sample string 1","userName":"sample string 2","password":"sample string 3","clientKey":"sample string 4"}
application/xml, text/xml
<OAuthRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Yindo.DAL.Types"> <clientKey>sample string 4</clientKey> <grant_type>sample string 1</grant_type> <password>sample string 3</password> <userName>sample string 2</userName> </OAuthRequest>
application/x-www-form-urlencoded
grant_type=value&userName=value&password=value&clientKey=value
Response Information
Resource Description
OAuthToken| Name | Description | Type | Additional information |
|---|---|---|---|
| access_token |
This token is generated by the OAuth system and needs to be supplied in the Authorize header in subsequent requests. |
string |
None. |
| token_type |
The type of token. This will be set to bearer |
string |
None. |
| expires_in |
The number of seconds in which this token expires. |
integer |
None. |
| userName |
The username for which this token was issued. |
string |
None. |
| userID |
The userId for which this token was issued. |
string |
None. |
| sessionKey |
The sessionkey for the new session that was created with this login. |
string |
None. |
| clientKey |
The client supplied key for the new session that was created with this login. |
string |
None. |
Response Formats
application/json, text/json
{
"access_token": "sample string 1",
"token_type": "sample string 2",
"expires_in": 3,
"userName": "sample string 4",
"userID": "sample string 5",
"sessionKey": "sample string 6",
"clientKey": "sample string 7"
}
text/javascript
{"access_token":"sample string 1","token_type":"sample string 2","expires_in":3,"userName":"sample string 4","userID":"sample string 5","sessionKey":"sample string 6","clientKey":"sample string 7"}
application/xml, text/xml
<OAuthToken xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Yindo.DAL.Types"> <access_token>sample string 1</access_token> <clientKey>sample string 7</clientKey> <expires_in>3</expires_in> <sessionKey>sample string 6</sessionKey> <token_type>sample string 2</token_type> <userID>sample string 5</userID> <userName>sample string 4</userName> </OAuthToken>