Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 15 Current »

Requesting a Token

Once you have an access key, you can request a token using the token REST API. A typical request includes these elements:

URL

HTTP Header:

Content-type:application/json
x-api-key: "<Access Key>"

The parameters in the HTTP header are described in this table.

Parameter

Description

x-api-key

The access key ID for which you want to generate a token. its unique for each partner

Request Body

The request body contains all URL parameters as JSON body

{
"userId" : "userId",
"file" : "fileId",
"server": "apiServerURL",
any other supported parameter, see https://graebert.atlassian.net/wiki/spaces/KUDOPARTNER/pages/1180008643/Editor+parameters#General-Parameters
}

Response

If successful, the service will return a 200 status code with the token and expiration time.

status: 200 Ok
{
"token": "bbf18f21-3d0d-4a4c-b650-9c14d4075ce0",
"expiration_time": 1595917409
}

On error, the service will return a 403 error code with a descriptive error message.

status: 403 Forbidden
{
Wrong token
}

Token validation

You can optionally validate a token with the verification endpoint

URL

HTTP Header

Content-type:application/json
x-api-token: token

The parameters in the HTTP header are described in this table.

Parameter

Description

x-api-token

token generated using /generate endpoint

Response

If successful, the service will return a 200 status code with all URL parameters which is passed using /generate endpoint

Status: 200 OK
{
"auth" : "appId",
"userId" : "userId",
"file" : "fileId",
"server": "apiServerURL",
any other supported parameter, see https://graebert.atlassian.net/wiki/spaces/KUDOPARTNER/pages/1180008643/Editor+parameters#General-Parameters
}

On error, the service will return a 403 error code with a descriptive error message.

status: 403 Forbidden
{
Wrong token
}



  • No labels