Tokens

Tokens

Tokens are used internally in conjunction with custom URLs. Unless told otherwise you will likely not need to use them.

You can manage tokens by making the following requests:

RequestDescription
GET /tokensReturn the details of all of the tokens in your account
GET /tokens/:idReturn the details of a single token
PATCH /tokens/:idUpdate a token
DELETE /tokens/:idDelete a token
POST /tokensCreate a token

GET /tokens

Return the details of all of the tokens in your account.

Example request

curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/tokens"

Example response

{
"success": true,
"result": [
{
"id": "abcde12345abcde12345a",
"name": "Example token",
"type": "example",
"created_by": "abcde12345abcde12345a",
"created_time": "2021-01-01T12:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2021-01-01T12:00:00.000Z"
},
...
],
"links": {},
"errors": []
}

Optional parameters

NameTypeDefaultInformation
limitString25Maximum number to return
cursorString""Used to get the next page of results: if applicable we return this as part of the links.next URL

GET /tokens/:id

Return the details of a single token.

Example request

curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/tokens/abcde12345abcde12345a"

Example response

{
"success": true,
"result": {
"id": "abcde12345abcde12345a",
"name": "Example token",
"type": "example",
"created_by": "abcde12345abcde1234a",
"created_time": "2021-02-01T00:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2021-02-01T00:00:00.000Z"
},
"links": null,
"errors": []
}

Response format

KeyTypeDescription
idStringThe unique identifier given to this token
nameStringThe name given to this token
typeStringThe type of token
created_byStringThe ID of the user who created it (if known)
created_timeStringThe date and time it was created
updated_byStringThe ID of the user who last modified it (if known)
updated_timeStringThe date and time it was last modified

PATCH /tokens/:id

Update a token.

The body of the request should contain one, or more, attributes that you would like to update for the token. Please be very careful when making changes to existing items to avoid losing data, particularly if a particular token has sub-tokens.

Example request

curl \
-g \
-H "Authorization: Bearer YOUR-API-KEY" \
-H "Content-Type: application/json" \
-X PATCH \
-d '{"name":"New name"}' \
"https://api.vidbeo.com/v2/tokens/abcde12345abcde12345a"

Example response

{
"success": true,
"result": {
"id": "abcde12345abcde12345a",
"name": "New name",
"type": "example",
"created_by": "abcde12345abcde1234a",
"created_time": "2021-02-01T00:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2021-02-01T00:00:00.000Z"
},
"links": null,
"errors": []
}

DELETE /tokens/:id

Delete a token.

Example request

curl \
-H "Authorization: Bearer YOUR-API-KEY" \
-X DELETE \
"https://api.vidbeo.com/v2/tokens/abcde12345abcde12345a"

Example response

{
"success": true,
"result": {},
"links": null,
"errors": []
}

POST /tokens

Create a token.

Note the addition of the value field in the response. That is only revealed once here so make a note of it.

Example request

curl \
-g \
-H "Authorization: Bearer YOUR-API-KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{"type":"example", "name": "Example"}' \
"https://api.vidbeo.com/v2/tokens"

Example response

{
"success": true,
"result": {
"id": "abcde12345abcde12345a",
"name": "Example",
"type": "example",
"value": "THE-NEW-TOKEN",
"created_by": "abcde12345abcde1234a",
"created_time": "2021-02-01T00:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2021-02-01T00:00:00.000Z"
},
"links": null,
"errors": []
}

Required parameters

You need to provide a type and a name. The value of type depends on the purpose of the token: we will provide you with this value.

KeyTypeDescription
typeStringThe type of token
nameStringThe name of the token (1-50 characters)