Authentication REST API
2.1 /Tokens/ resource
Supported methods: | POST | ||
---|---|---|---|
Arguments : | Username | String | Required |
Password | String | Required | |
AgentId | String | Required | |
Response Codes : | 200 OK | Authentication successful | |
401 Not Authorised | Invalid Username, password or agent id | ||
Response Body : | Token | String | Required |
Since Version : | 1 |
The /tokens/ resource allows the creation of new authentication tokens for use with the Collaboration and Provisioning APIs. For an overview of how authentication works in the MindLink API, see section 1.4.The /tokens/ resource supports only the POST method – there is no way to enumerate all tokens. The POST payload must contain three arguments:
Username – the account name of the user wishing to use the API Password – the password for the given account AgentId – the ID of the agent the user wishes to use when accessing the API
On success, the newly generated token will be returned. This will need to be passed to any call made to the Collaboration or Provisioning APIs. Information on the token is available via the /Tokens/{token}
resource.The ‘super user’ (configurable using the management tool) may authenticate and access the provisioning service. This can be done using an empty ‘AgentId’.
2.2 /Tokens/{token} resource
Supported methods: | GET | ||
---|---|---|---|
Arguments : | {token} | String | Required |
Response Codes : | 200 OK | Token Exists | |
400 Bad request | if the token has expired or it doesn't exist | ||
Response Body : | Token information | TokenDetails | Required |
Since Version : | 1 |
The /Tokens/{token}
resource retrieves information about the specified token. No authentication is required in order to access this resource.The resource returns a TokenDetails object, which contains the following members:
Username (string) : the (Windows) username associated with the token
AgentID (string) : the unique Agent ID associated with the token
ExpiresTimestamp (long) : the timestamp at which the token will expire
Sample Code Repository
Sample code can be downloaded from https://github.com/mindlink/api-samples