Create a new token#

Description#

Creates a temporary token—valid for only a short period of time—to download a table dataset file or query result, given its ID.

POST /api/v1/token

Required OAuth Scopes

No OAuth scopes are required to use this endpoint.

Parameters#

Parameter

In

Type

Required

Description

body

body

TokenDto

true

The representation of the token to update

Body parameter example#

{
  "objectId": "string",
  "useFlatKey": true
}

Code Samples#

curl -X POST https://h.app.wdesk.com/s/wdata/prep/api/v1/token \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer {access-token}'
http POST https://h.app.wdesk.com/s/wdata/prep/api/v1/token \
    Content-Type:application/json \
    Accept:application/json \
    Authorization:"Bearer {access-token}"
wget --method=POST "https://h.app.wdesk.com/s/wdata/prep/api/v1/token" \
    --output-document -  \ 
    --header 'Content-Type: application/json' \ 
    --header 'Accept: application/json' \ 
    --header 'Authorization: Bearer {access-token}'
import requests

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://h.app.wdesk.com/s/wdata/prep/api/v1/token', headers = headers)

print(r.json())

Returns#

201 - Created#

Returns a JSON object with a body property, which contains a TokenDto object for the created token.

Example Responses#

{
  "body": {
    "created": "string",
    "id": "string",
    "objectId": "string",
    "updated": "string",
    "useFlatKey": "boolean",
    "userId": "string",
    "version": "integer"
  },
  "code": "integer"
}