Create an Access Token for an Application

post

/api/v2/applications/{id}/tokens/

Make a POST request to this resource with the following access token fields to create a new access token associated with this application.

  • description: Optional description of this access token. (string, default="")

  • scope: Allowed scopes, further restricts user's permissions. Must be a simple space-separated string with allowed scopes ['read', 'write']. (string, default="write")

Request

Supported Media Types
Path Parameters
Body ()
Root Schema : schema
Example:
{
    "scope":"read"
}
Back to Top

Response

Supported Media Types

201 Response

Body
Example Response (application/json)
{
    "application":"1",
    "created":"2018-02-01T08:00:00.000000Z",
    "description":"",
    "expires":"2018-02-01T08:00:00.000000Z",
    "id":"1",
    "modified":"2018-02-01T08:00:00.000000Z",
    "refresh_token":"QjwdSLwiYFxMGYJ31U0cyXJirXhKkh",
    "related":{
        "activity_stream":"/api/v2/tokens/1/activity_stream/",
        "application":"/api/v2/applications/1/",
        "user":"/api/v2/users/1/"
    },
    "scope":"read",
    "summary_fields":{
        "application":{
            "id":"1",
            "name":"test app"
        },
        "user":{
            "first_name":"",
            "id":"1",
            "last_name":"",
            "username":"admin"
        }
    },
    "token":"CzPw3Fyb2mmaaOBhhq6GGrus2w4R17",
    "type":"o_auth2_access_token",
    "url":"/api/v2/tokens/1/",
    "user":"1"
}
Back to Top