Getting Started With CTMS
Note:
The MediaCentral | Media Suite API (also referred to as Connectivity Toolkit Media Services or CTMS API) is a family of HAL/REST APIs that allow access to the functionality of CloudUX systems and modules in a common way. This usually includes the following steps:
- Authenticate
- Query the CTMS Registry over HTTP to obtain a core set of links
- Make REST calls to the URLs within these links. The results are HAL resources with further links to additional functionality.
Through this iterative approach, code can navigate the entire API. The only hardcoded links required are any for authentication and the resource root for the CTMS Registry.
Using the API needs to adhere to the following principles:
- Caching and reusing a link within an active session is considered a good practice.
- Hardcoding other links or calling services via other transports (for example via direct Avid Platform bus calls or using the ACS Monitor) is not supported. Any implementation behavior that appears to function today may cease to work in the future as resource roots and sub-resource paths may change without notice as part of normal feature release work.
This tutorial shows how to send and receive request via Postman.
Prerequisites
Postman App. You can download Postman using this link: Download Postman App.
Application ID and Application Secret. To get Application ID and Application Secret you need:
Authentication
Before calling CTMS methods client must authenticate against the platform. After successful login client gets an access_token that is used in later requests to REST API like check-in an AAF file or List folder.
The access token should be added to the header.
Step 1
Before getting access token we need to obtain the authentication entry point resource. This is available under https://CloudUX_Hostname/auth link.Step 2
Client must select an identity provider as an authority that handles the login / verifies user credentials.auth:identity-providers
resource enables discovery of available identity providers which may be then found in the supplied URL.
Step 3
Now making request to auth:ropc-default
resource you can obtain the access_token.
- After clicking on "Send" button you'll get your access_token:
Note: by default, the access token has an expiration time of 15 minutes.
Automatically set Authentication tokens in Postman requests
When working with the APIs it's common to have to set Bearer token on each request. The usual workflow would be to create an authentication request. After getting a valid token you have to manually copy this token to header "Authorization" for each request. Below you can find the way to automate this process.
Step 1
You need to manage your environment and add new set of variables:
Step 2
Now you can use your enviroment variables for.
Step 3
Try to get access token for current request.
Enumerate all available systems
To continue with the following guides you need to know systems connected to CloudUX such as PM, AM, NM etc. For this you can do the following request.
Step 1
CloudUX has a registry service that contains list of all connected systems. Use the following request to obtain registry:serviceroots
resource. The CTMS Registry collects the HAL resources provided by all the different CTMS services on the platform.
Step 2
Now making request to registry:serviceroots
you can see what systems are connected to your CloudUX.
List items in folder
To get the item of the folder structure and list items in this folder you can do the following requests.
Step 1
To list items in the root folder you need to use response from the step above: Enumerate all available systems
Step 2
For this example we will list items in /Projects folder. From response above, you need a link under _embedded.loc:item._links.self
for “/Projects” folder.
Create folder inside folder item
CloudUX has loc:create-folder
link relation for folder in loc:item
resource. This allows you to add a new folder to the folder item.
Asset by id
To get the information about an asset, including the common attributes you can do the following requests.
To list items in the root folder you need to use response from the step above: Enumerate all available systems
Time-based
CloudUX has aa:time-based
resource to represent the time-based annotation of an asset. To update layer or delete parts of the time-based annotation you can use link relations of aa:time-based
resource.
Step 1
To get the time-based annotation of an asset you need to use response from the step above: Asset by id
Step 2
To update existing segment of time-based annotation you need to use aa:update-time-based
link relation of the aa:time-based
resource. From response above: get time-based, you need a link under _links.aa:update-time-based
.
Step 3
To delete parts of the time-based annotation you need to use response from the step above: get time-based, you need a link under _links.aa:delete-time-based
.
Move item
To move a single location item to the folder item you can do the following request.
To move location item or folder to another folder you need to use response from the step above: List items in folder
Add a copy of the item
CloudUX allows you to add a copy of an existing item (an asset, a location item, a folder) to the folder collection.
To add item into another folder you need to use response from the step above: List items in folder