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:
GET /tokens
Example request
shell
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/tokens"
Example response
json
{
"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
Name | Type | Default | Information |
---|---|---|---|
limit | String | 25 | Maximum number to return |
cursor | String | "" | Used to get the next page of results: if applicable we return this as part of the links.next URL |
GET /tokens/:id
Example request
shell
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/tokens/abcde12345abcde12345a"
Example response
json
{
"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
Key | Type | Description |
---|---|---|
id | String | The unique identifier given to this token |
name | String | The name given to this token |
type | String | The type of token |
created_by | String | The ID of the user who created it (if known) |
created_time | String | The date and time it was created |
updated_by | String | The ID of the user who last modified it (if known) |
updated_time | String | The date and time it was last modified |
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
shell
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
json
{
"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 /tokens/:id
Example request
shell
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
-X DELETE \
"https://api.vidbeo.com/v2/tokens/abcde12345abcde12345a"
Example response
json
{
"success": true,
"result": {},
"links": null,
"errors": []
}
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
shell
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
json
{
"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.
Key | Type | Description |
---|---|---|
type | String | The type of token |
name | String | The name of the token (1-50 characters) |