You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »


Before using the API, you need authorization to access a VideoManager. Authorization is granted by creating an access and refresh token. These are strings used to identify a user after they provide valid login credentials.

Token TypeDescriptionValid for...
Access TokenThis is required to grant access to the data provided by the API.5 minutes
Refresh Token

Use this to generate a new access token after the old one expires. This allows access to continue without the need to provide login credentials again.

1 hour

Use the "Create access and refresh token" method described below (and on Apiary here) to provide login credentials in exchange for both of these tokensIf you have multiple VideoManagers, the response will show which VideoManager the access token is assigned to. To gain access to a specific VideoManager, use the "Create refresh token" method described below (and on Apiary here).



The URLs in the methods below refer to the general live instance of movingimage. Customers using a VideoManager on a custom domain must adjust the URLs accordingly.



Create Access and Refresh Token Request

curl -X POST -H "Content-Type: application/json" -d "{
	'username':'<USERNAME>', 
	'password':'<PASSWORD>'
}" https://api.video-cdn.net/v1/vms/auth/login
JSON BodyData TypeDescription
usernameStringmandatory: User name for VideoManager Pro
passwordStringmandatory: User's password

Sample Response

{
    "accessToken": <ACCESS_TOKEN>,
    "refreshToken": <REFRESH_TOKEN>,
    "videoManagerList": [{"id":<VIDEOMANAGER_ID>,"name":<VIDEOMANAGER_NAME>}, {...}],
    "validForVideoManager": "<VIDEOMANAGER_ID>"
}



Create Refresh Token Request

Use this method if your accessToken expires to generate a new one. If you have access to more than one VideoManager, this method is also useful for specifying which VideoManager you would like to access.

curl -X POST -H "Content-Type: application/json" -d "{
	'refreshToken':'<REFRESH_TOKEN>'
}" https://api.video-cdn.net/v1/vms/auth/refresh/<VIDEOMANAGER_ID>
ParametersData TypeDescription
VIDEOMANAGER_IDStringmandatory: ID of the VideoManager that you are trying to gain access to.
JSON Body

refreshTokenStringmandatory: Use the refreshToken from the response body of the "Create Access and Refresh Token" method described above.

Sample Response

{
    "accessToken": <ACCESS_TOKEN>,
    "refreshToken": <REFRESH_TOKEN>,
    "videoManagerList": [{"id":<VIDEOMANAGER_ID>,"name":<VIDEOMANAGER_NAME>}, {...}],
    "validForVideoManager": "<VIDEOMANAGER_ID>"
}




Using the Access Token

Once you have an access token that is valid for the desired VideoManager, you can use the rest of the API methods by including it in the header of each request. The following uses the "Get VideoManagers" method to demonstrate this:

curl -X GET -H "Authorization: Bearer <ACCESS_TOKEN>" https://api.video-cdn.net/v1/vms