API Token Management
Viewing and destroying API tokens.
Notice
There is no method to find out about the actual token. It is up to the client to save token after generation; however, it is possible to view the details of tokens that are in use.
GET /api/v2/accesstoken/all [SECURED]
Retrieval of access token usage and history. This is useful for keeping log or track of API usage. For security reasons, the access token will not be listed. If an access token has been assigned to a server, it is better to identify by IP address. Alternatively, if a name is designated when creating new access tokens, it can be used to idenfity a particular token.
Responses
200 OK
Response Details (JSON)
See GET /api/v2/accesstoken/generate for each item's properties.
Example
{
"status": 200,
"count": 2,
"returnCode": 3,
"items": [
{
"name": "default",
"creation_date": "2016-09-06T13:45:23",
"last_used": "2016-10-13T14:13:36",
"ip_address": "72.223.222.131"
},
{
"creation_date": "2016-10-01T11:13:56",
"last_used": "2016-10-12T15:13:32",
"ip_address": "127.0.0.1"
}
]
}
GET /api/v2/accesstoken [SECURED]
Returns usage details for token provided in Authorization
header.
Responses
200 OK
Response Details (JSON)
See GET /api/v2/accesstoken/generate
Example
{
"status": 200,
"returnCode": 1,
"token": {
"name": "POS1",
"creation_date": "2016-12-30T01:13:35",
"last_used": "2017-01-23T15:13:10",
"ip_address": "192.168.2.1"
}
}
DELETE /api/v2/accesstoken [SECURED]
Revoke token identified by header Authorization
.
If another access token is desired to be removed, it must call this request under the context of itself (i.e. self-destruction). This prevents tokens from being deleted by another. It is in the best interest of integrator/developer to keep track of tokens that are generated.
Responses
200 OK
{
"status": 200,
"returnCode": 1001,
"message": "Token deleted."
}
Updated almost 8 years ago