Tokens

Tokens

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

If you need to, you can manage tokens by making the following requests:

Return the details of all of the tokens
GET /tokens

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
Return the details of a token
GET /tokens/:id

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": "2022-01-01T00:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2022-01-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
Update a token
PATCH /tokens/:id

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": "2022-01-01T00:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2022-01-01T00:00:00.000Z"
},
"links": null,
"errors": []
}
Delete a token
DELETE /tokens/:id

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": []
}
Create a token
POST /tokens

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": "2022-01-01T00:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2022-01-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)