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 12 Next »

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

{
"auth" : "appId",
"file" : "filePath",
"userId" : "userId",
"server": "serverURL",
"param": "value"
}

The parameters in the body are described in this table.

Parameter

Description

auth

Application identifier associated with the partner

userId

partner defined user id

fileUrl

URl to the file to open. Read only access

file

Identifier of designated file in backend system (instead of fileUrl; if both are passed file is taken with priority)

server

Url of the API server

locale

Set the user interface language

access

Set the editing or view UIĀ  (edit or view)

  • Note: access=view blocks storing any changes the user makes back to the storage. access=edit will automatically store changes on fixed intervals and on session close.

autosavedisabled

Set disabled auto save (false or true)

  • Note: autosavedisabled = true , Disable automatic saving in edit session. Changes made to the drawing are not saved unless the SAVE command is executed explicitly.

sessionId

id send with each API request

workspace

Overwrite the default UI workspace used for editing UI (see https://graebert.atlassian.net/wiki/x/DAFgRg)

viewerWorkspace

Overwrite the default UI workspace used for view UI (see https://graebert.atlassian.net/wiki/x/DAFgRg)

mobile

Load a mobile friendly UI (false or true)

debug

Provide debugging output and features (false or true)

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" : "apiKey",
"file" : "filePath",
"userId" : "userId",
"server": "server",
"param": "value"
}

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

status: 403 Forbidden
{
Wrong token
}



  • No labels