About APIs & API Documentation

Prev Next

Accessing Additional API Documentation

While some general information about Content Manager's API functionality is provided on this page below, complete API documentation is available separately from this knowledge base. Follow the steps below to open the API documentation.

  1. Click the System icon

  2. In the menu, select View API Documentation.

API Information

The examples found on this page represent a sampling of the common API calls in Content Manager.

Authentication

The Authentication.Login API is used to log into the Content Manager.  The response to this API call contains the apitoken and token data fields.  All other requests must contain these two tokens or the response will be 401 Unauthorized.

Login to Content Manager

Service Name

API Call

Call Type

Call Description

Login to Content Manager

/api/rest/auth/login

POST

Login to Content Manager

Logout of Content Manager

/api/rest/auth/logout

GET

Logout of Content Manager.

Third party applications cause an issue with a buildup of security tokens that can be removed by logging out of the user session, or having it time out.

File Upload

Semi-RESTful service for uploading files. These functions are not testable through the API docs page.

Service Name

API Call

Call Type

Call Description

Initiate upload

/api/rest/fileupload/init

POST

Begin a file upload and obtain a unique user id (uuid).

Upload File Part (PUT)

/api/rest/fileupload/part/{uploadId}/{offset}

PUT

Send one part of a multipart file upload.

Upload Single File (POST)

/api/rest/fileupload/part/{uploadId}/{offset}

POST

Upload media data. Once all data is transfered, the server will automatically call 'complete' service.

Upload finished

/api/rest/fileupload/complete/{uploadId}

POST

Indicates all parts of the file have been sent via fileupload/part

Media

RESTful service for media.

Service Name

API Call

Call Type

Call Description

Upload Single Media

/api/rest/media/{id}

PUT

Update media.

Find media's categories

/api/rest/media/{id}/categories

GET

List all categories for a media.

Find media's workgroups

/api/rest/media/{id}/workgroups

GET

List all workgroups for a media.

Delete media by ID

/api/rest/fileupload/complete/{uploadId}

POST

Indicates all parts of the file have been sent via fileupload/part.

Create media

/api/rest/media

POST

Create new media.

Note on Create Media API

Name is unique for the HTML media type. Media needs to be uploaded into Content Manager, but the HTML media type CANNOT be uploaded. This service allows you to create new HTML media.

Here is an example of request body for creating new HTML media. The name, URI and mediaType attributes are required. In this sample, we'll name the media 'Scala Home' and let URL be http://www.scala.com.

{ 
name : "Scala Home",
uri : "http://www.scala.com",
mediaType : "HTML"
}

Players

RESTful service for players.

Service Name

API Call

Call Type

Call Description

Get current state for a player

/api/rest/players/{id}/state

GET

Returns information about the current state of a player.

Get current state for one or more player

/api/rest/players/{uuid}/states

GET

Returns information about the current state of one or more player.

Use Storage service and store IDs of the players you want to retrieve the state. Store it as JSON object like this:

{ 'ids' : [1, 5] }

The Storage service will return an UUID to be used in the request parameter.

List Players

/api/rest/players

GET

Returns one or more player's information.

Update Players

/api/rest/fileupload/complete/{uploadId}

PUT

N/A

Note on Get Current State for One or More Player API

The service will not raise an exception if you pass on a non-existing player id or player id belongs to another network.

Note on Update Players API

Assigning player metadata to a player: Use the List service of Player Metadata to find out the id of the Metadata and then pass that id to set the metadata value in player Consider a scenario where a boolean player metadata 'testBoolean' has been created. Now, To update the value of the metadata 'testBoolean' for a player we need to find the id of the metadata. The id of the metadata can be found using 'List Player metadata service' let's say it is '1'. So, the metadataValue object will look like this:

{
metadataValue: [{
value: TRUE,
playerMetadata:{
id : 1 ,
name : "testBoolean",
datatype : BOOLEAN,
valueType : ANY
}
}]
}

The value attribute of 'metadataValue' object is set to 'TRUE' here. If the values are set to FALSE, they will be absent, as they are blank.

Users

Service Name

API Call

Call Type

Call Description

Create a user

/api/rest/users

POST

Create a new user.

Delete a user by id

/api/rest/users/{id}

DELETE

Delete user by id.

Find a user by id

/api/rest/users/{id}

GET

Returns information about the user.

Update a User

/api/rest/users/{id}

PUT

Update user.