JWT keys
If you have a video whose privacy is set as authenticated then a valid cookie or JSON Web Token (JWT) is required to be sent along with the request for its landing page, embed code or HLS manifest.
Please see our guide on making a public and private key, along with the expected structure of the JWT: How do I use a JWT to authenticate private videos.
Manage your JWT keys by making the following requests:
GET /jwt_keys
Example request
shell
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/jwt_keys"
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/jwt_keys"
Example response
json
{
"success": true,
"result": [
{
"id": "abcde12345abcde12345a",
"name": "Example key",
"public_key": "-----BEGIN PUBLIC KEY-----...",
"created_by": "abcde12345abcde12345a",
"created_time": "2021-01-01T12:00:00.000Z",
"updated_by": "abcde12345abcde12345a",
"updated_time": "2021-01-01T12:00:00.000Z"
},
...
],
"links": {},
"errors": []
}
{
"success": true,
"result": [
{
"id": "abcde12345abcde12345a",
"name": "Example key",
"public_key": "-----BEGIN PUBLIC KEY-----...",
"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 /jwt_keys/:id
Example request
shell
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/jwt_keys/abcde12345abcde12345a"
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
"https://api.vidbeo.com/v2/jwt_keys/abcde12345abcde12345a"
Example response
json
{
"success": true,
"result": {
"id": "abcde12345abcde12345a",
"name": "Example key",
"public_key": "-----BEGIN PUBLIC KEY-----...",
"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": []
}
{
"success": true,
"result": {
"id": "abcde12345abcde12345a",
"name": "Example key",
"public_key": "-----BEGIN PUBLIC KEY-----...",
"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 JWT key |
name | String | The name given to this JWT key |
public_key | String | The public half of the private/public key-pair you create: the certificate used to verify the JWT |
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 |
DELETE /jwt_keys/:id
Example request
shell
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
-X DELETE \
"https://api.vidbeo.com/v2/jwt_keys/abcde12345abcde12345a"
curl \
-H "Authorization: Bearer YOUR-API-KEY" \
-X DELETE \
"https://api.vidbeo.com/v2/jwt_keys/abcde12345abcde12345a"
Example response
json
{
"success": true,
"result": {},
"links": null,
"errors": []
}
{
"success": true,
"result": {},
"links": null,
"errors": []
}
POST /jwt_keys
Example request
shell
curl \
-g \
-H "Authorization: Bearer YOUR-API-KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{"name":"New key", "public_key": "----- BEGIN PUBLIC KEY -----\nMIIII..."}' \
"https://api.vidbeo.com/v2/jwt_keys"
curl \
-g \
-H "Authorization: Bearer YOUR-API-KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{"name":"New key", "public_key": "----- BEGIN PUBLIC KEY -----\nMIIII..."}' \
"https://api.vidbeo.com/v2/jwt_keys"
Example response
json
{
"success": true,
"result": {
"id": "abcde12345abcde12345a",
"name": "New key",
"public_key": "-----BEGIN PUBLIC KEY-----...",
"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": []
}
{
"success": true,
"result": {
"id": "abcde12345abcde12345a",
"name": "New key",
"public_key": "-----BEGIN PUBLIC KEY-----...",
"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 give the new JWT key a name
and send its public_key
.
Key | Type | Description |
---|---|---|
name | String | A name for the JWT key (1-50 characters) |
public_key | String | The public half of your private/public key pair |