Description
The DeleteToken API allows users and devices to delete their own Tokens or Account Owners to delete devices and users' Tokens, essentially logging a user or a device out of a token-based authentication session. If a Token cookie was sent in the request, this API also attempts to delete the Token cookie from the user's browser by setting the cookie expiry in the response.
Specific Request Parameters
(Refer to Common Request Parameters)
Unlike other APIs, the "apsdb.authToken" and "apsws.id" parameters are not just used to authenticate the request but also to specify which user or device token to delete. Although these parameters are not mentioned below, they are required for a user or a device to delete their own token.
Name | Description | Required | Default | Possible Values |
---|---|---|---|---|
idList | This parameter has to be sent by the account owner to specify the list of users and/or devices identifiers whose tokens are to be deleted. When sending this parameter, "apsdb.authToken" and "apsws.id" parameters should not be sent. Note: The owner can delete up to 100 device or user in the same request. | No |
| Comma separated list of device's or user's ids |
Specific Logical Errors
(Refer to Common Logical Error Codes)
Error | Message | Status Code |
---|---|---|
DUPLICATE_PARAMETER_VALUE | Duplicate value not allowed for parameter "apsdb.authToken" | 400 |
INVALID_PARAMETER | The parameter [paramName] is not allowed in DeleteToken The parameter [idList] is not allowed for user or device requests. The parameter list [idList,userList] is not allowed for user or device requests. | 400 |
INVALID_TOKEN | Could not find the token [token] | 400 |
INTERNAL_ERROR | 500 | |
IDENTIFIERLIST_REQUIRED | The parameter idList is required | |
IDENTIFIER_TOKEN_REQUIRED | The parameter apsdb.authToken is required. | 400 |
INVALID_IDENTIFIERLIST | The parameter idList should not contain more than 100 identifiers. | 400 |
INVALID_SIGNATURE |
| 400 |
INVALID_REQUEST | DeleteToken is not allowed over non-secure connections. | 400 |
MALFORMED_REFERER | Invalid originating referrer from the Referer header [RefererHeaderString] | 400 |
Examples
Sample Request
Request URL: http://sandbox.apstrata.com/apsdb/rest/[AuthenticationKey]/DeleteToken?apsws.time=[timestamp]&apsws.authSig=[signature]
POST parameters:
idList=lila idList=domingo@dodge.com idList=hybiscus@flowers.com
Sample Response
Success XML:
<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd"> <metadata> <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId> <status>success</status> </metadata> </response>
Failure XML:
<response xmlns="http://www.apstrata.com/services/schemas/apstrata_database_response.xsd"> <metadata> <requestId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</requestId> <status>failure</status> <errorCode>[errorCode]</errorCode> <errorDetail>[failMsg]</errorDetail> </metadata> </response>
Sample JSON Response
{"response": { "metadata": { "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "status": "success" } }}