Requirements
- API client (e.g. Postman) or cURL
- Admin credentials for your VideoManager Pro account
Objective
By default, files of uploaded videos in your VideoManager Pro account (such as the file of the video itself but also thumbnails, chapters, thumbnails, attachments or subtitles files) are protected with tokens provided in the file's download URL.
Your VideoManager Pro account generates a download link with a token with a limited duration. In general tokens are valid for ten minutes; for video downloads they are valid for three times the length of a video. After the time limit has elapsed, the link will not be valid anymore and a new link with a new token will be dynamically generated.
Tokens ensure that
- Your files are by default protected, since the download URL must contain a specific token valid for a specific duration to be valid. Otherwise, there is a risk that external users may potentially reconstruct a download URL.
- the download URL cannot be shared via email, for example, since they will shortly expire after a short while.
Example of non-protected download URL
https://asset-out-cdn.video-cdn.net/public/videos/{{video_id}}/thumbnails/78912?quality=360p
Example of non-protected download URL
https://asset-out-cdn.video-cdn.net/private/videos/{{video_id}}/thumbnails/78912?quality=360p&__token__=exp=1519826701~acl=***~hmac=***
Note that the unprotected file specifies "/public/" in the URL instead of "/private/", and does not include a token.
If you want to share a download URL, you might deactivate the token protection for a single or multiple videos from your VideoManager Pro account or even for all videos in the account. After the users have downloaded the video, you can restore token protection in your video/VideoManager Pro account.
Follow the instructions in this guide to find out how you can deactivate and/or reactivate the token protection on a specific video or on a whole VideoManager Pro.
The following guides is for you if you're using an API client (e.g. Postman). If you want to use a cURL call or import it in your API client, scroll to the bottom of this page or click here.
Before starting, you need to get an access token of an admin user to run any calls contained in this guide. If you do not know how to get an access token, click here. For all calls contained in this guide, you will need also the VideoManager Pro ID of your account.
NOTE
You can find your VideoManager Pro ID in the "Account" Tab of your VideoManager Pro Administration area.
Guides contained in this article:
1. Deactivate token protection for an entire VideoManager Pro account with an API client (e.g. Postman) or with cURL.
2. Activate token protection for an entire VideoManager Pro account with an API client (e.g. Postman) or with cURL.
3. Deactivate token protection for a specific video with an API client (e.g. Postman) or with cURL.
4. Activate the token protection on a specific video with an API client (e.g. Postman) or with cURL.
Step-by-step guide How to deactivate/reactivate the token protection for all videos in a VideoManager Pro account:
Follow these steps to deactivate the token protection for all download URLs (e.g. the video itself, subtitles, attachments, etc.) for all videos in your VideoManager Pro:
NOTE This setting will apply not only to all videos that are currently in your VideoManager Pro but also to videos that will be uploaded in the future until you revert this setting.
1. Open a new empty request on Postman (or any other API client).
2. Select POST as method.
3. Insert the following URL in the request URL bar (replace {videoManagerId} with the id of your VideoManager Pro).
https://api.video-cdn.net/v1/vms/{videoManagerId}/asset-type/security-override
4. In the request headers, add Authorization as key and Bearer {token} as value. Replace {token} with an access token, taken with the credentials of an admin on your account. Click here to know how to get an access token.
5. Click on "Send" button.
You will get an empty body response with a status code 200. Now, the download URLs of all video of your VideoManager Pro are no longer token-protected.
To reactivate the token protection on all your VideoManager Pro account, run the same call described in this guide. However, use DELETE as method instead of POST.
How to deactivate the token protection for a specific video:
You want to deactivate token protection for one (or some) specific videos on your account but not for all of them.
1. Open a new empty request on Postman (or any other API client).
2. Select POST as method.
3. Insert the following URL in the request URL bar (replace {videoManagerId} with the id of your VideoManager Pro and {videoManagerId} with the video id of the video, from which you wish to deactivate the token protection).
https://api.video-cdn.net/v1/vms/{videoManagerId}/videos/{videoId}/security-override
4. In the request headers, add Authorization as key and Bearer {token} as value. Replace {token} with an access token, taken with the credentials of an admin on your account. Click here for the guide on how to get an access token.
In the second header, add Content-Type as key and application/json as value.
5. Paste in the body (as raw text) the following code.
{
"scope": "public"
}
NOTE
If you want to deactivate the token protection for some download URLs (e.g. for subtitles) but not for all video sources, you have to change the body value. Click here for more information.
6. Click on "Send" button.
You will get an empty body response with a status code 200. Now, the download URLs of the video have no token protection.
How to reactivate the token protection for a specific video level:
You want to reactivate the token protection for a specific video. You shared a download video URL for a certain period of time, and you want your video to be protected again.
1. Open a new empty request on Postman (or any other API client).
2. Select DELETE as method.
3. Insert the following URL in the request URL bar (replace {videoManagerId} with the id of your VideoManager Pro and {videoManagerId} with the video id of the video, from which you wish to deactivate the token protection).
https://api.video-cdn.net/v1/vms/{videoManagerId}/videos/{videoId}/security-override
4.In the request headers, add Authorization as key and Bearer {token} as value. Replace {token} with an access token, taken with the credentials of an admin on your account. Click here for the guide on how to get an access token. In the second header add Content-Type as key and application/json as value.
5. Click on "Send" button.
You will get an empty body response with a status code 200. Now, the download URLs of the video are token-protected again.
Alternatives with cURL calls
You can just import the following cURL call into Postman or another API client, or use the cURL call in a cURL software. Replace {VideoManagerId}, {videoId} and {token} with the relevant information.
Deactivate token protection on download URLs for a VideoManager Pro account with cURL
curl --location --request POST 'https://api.video-cdn.net/v1/vms/{videoManagerId}/security-override' \
--header 'Authorization: Bearer {token}'
Reactivate token protection on download URLs for a VideoManager Pro account with cURL
curl --location --request DELETE 'https://api.video-cdn.net/v1/vms/{videoManagerId}/security-override' \
--header 'Authorization: Bearer {token}'
Deactivate the token protection for a specific video with cURL
curl --location --request POST 'https://api.video-cdn.net/v1/vms/{videoManagerId}/videos/{videoId}/security-override' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"scope": "public"
}'
Reactivate the token protection for a specific video with cURL
curl --location --request DELETE 'https://api.video-cdn.net/v1/vms/{videoManagerId}/videos/{videoId}/security-override' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw ''
Comments
0 comments
Article is closed for comments.