The Tokens Resource

POST /tokens

If given valid username and password credentials, creates a sessionToken. The sessionToken contains the key/token pair needed to sign subsequent requests. The sessionToken will expire after 24 hours of no activity.

The sessionToken also contains the user's userId which can be used for user related requests and an indication if the user has the admin role.

Request

Body

{
    "credentials": {
        "name": "my_user_name",
        "password": "my_password_123"
    }
}

Response

Body

{
    "sessionToken": {
        "userId": 45,
        "key": "8d7bd346-f65f-49ed-ae3f-4599251abdec",
        "token": "54ed941e-c9fb-4eb0-b198-70a7f8ac5738",
        "admin": false
    }
}

DELETE /tokens/{sessionKey}

Deletes the sessionToken with the given sessionToken.key.

Request

Path parameter

sessionKey is a sessionToken.key value previously returned in a POST /tokens request.

Header Parameters

authentication headers

Response

A successful delete results in a 204 No Content response.

Page last modified on May 05, 2017, at 03:46 PM