Requirement
- an API client, such as Postman or Insomnia.
Objective
Before using the movingimage REST API, you need authorization to access a VideoManager Pro account.
Authorization is granted when valid proof of identity is provided along with an API request for data. This proof of identity will take the form of a JSON Web access token (bearer token), which is a unique string used to identify a user.
How to get a access token with an API client
NOTE
In this guide, we will show you how to use the Postman API client. You can also use other clients with the same function. If you wish just to import or directly use a cURL call, navigate to the bottom of this page or click here.
1. Open Postman (or any other API client).
2. Open a new empty request.
3. Select POST as method.
4. Insert the following URL in the request URL bar.
https://api.video-cdn.net/v1/vms/auth/login
5. In the body (as raw text), paste the following code. Replace the username and the password with your VideoManager Pro credentials.
{
"username": "example@mycompany.com",
"password": "my_password"
}
NOTE
The rights of the token you will get are determined by the rights of the user whose credentials are inserted in the body. For instance, if you run an API call to change video metadata on a video, but the user credentials do not have the corresponding rights, this call will fail with a forbidden status code (403).
6. In Headers, insert Content-Type as key and application/json as value.
7. Click on the "Send" button. You will find the bearer/access token in the response of the call.
8. Copy the access token and paste it in your notepad.
Alternative: Get the Access Token with cURL
You can just import the following cURL call into Postman (or another API client) or use the cURL call in a cURL software. Replace example@mail.com and myPassword with your credentials.
curl --location --request POST 'https://api.video-cdn.net/v1/vms/auth/login' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "example@mail.com",
"password": "myPassword"
}'
Comments
0 comments
Article is closed for comments.