1. Home
  2. API's
  3. Dynamic Video-on-Demand API

Dynamic Video-on-Demand API

Video-on-Demand API allows other companies to integrate with Treepodia’s services.

Documentation for the old version (v032021) can be found here.

Authentication

To ensure the security and integrity of interactions with our API, every request must be accompanied by a valid access token. This token acts as a key, confirming that the request is made by an authenticated and authorized user or system.

To obtain an access token, clients need to utilize our Auth Service.

Auth request usage example

Request URL: https://api.treepodia.com/rest/vod/v012024/auth
Method: POST
Content Type: application/json
Body:
{
   "email":"[email protected]",
   "password":"123456",
   "expirationDate": 1646794257759
}

expirationDate – optional parameter, if it is not specified, the expiration will be in 2 weeks. The use of this parameter depends on the required level of security.

Successful response body

{
   "status": "SUCCESS",
   "accessToken": "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
   "expirationDate": 1646794257759
}

Authorization

To ensure secure communication with our API, each request must include proper authorization. This is achieved by attaching an access token to the request headers. Follow these steps to add the necessary authorization:

1. Obtain an access token through the appropriate authentication mechanism provided by the service.

2. Include this access token in the HTTP request by setting the `Authorization` header.

3. Prefix the access token with the word `Bearer`, followed by a space.

Here is the correct format for the `Authorization` header:

Authorization: Bearer <your_access_token_here>

Replace `<your_access_token_here>` with the actual access token you’ve obtained.

Please ensure the access token is kept confidential and secure, as it grants access to the API on your behalf. If your access token is lost or compromised, please contact support immediately to revoke the token and issue a new one.

List of available templates

The following service is for getting the list of an available templates.

Templates request usage example

Request URL: https://api.treepodia.com/rest/vod/v012024/acc/{uuid}/templates
Method: GET

Successful response body

{
   "templates": [
     {
       "id": 1111111111,
       "name": "Template 1",
       "description": "Template 1 description",
       "thumbnailPath": "https://api.treepodia.com/rest/vod/v032021/acc/UA-PERSOVIDDEMO/templates/1111111111/thumbnail"
     },
     {
       "id": 2222222222,
       "name": "Template 2",
       "description": "Template 2 description",
       "thumbnailPath": "https://api.treepodia.com/rest/vod/v032021/acc/UA-PERSOVIDDEMO/templates/2222222222/thumbnail"
     }
   ]
}

Template Parameters

The following service is for getting template parameters.

Parameter types:
text – Text value
image – Accessible from Internet image url
video – Accessible from Internet video url
select – Value from the list of values declared in values list
date – String version of date(for example value of date input field)
time – String version of date(for example value of time input field)

Template parameters request usage example

Request URL: https://api.treepodia.com/rest/vod/v012024/acc/{uuid}/templates/{templateId}
Method: GET

Successful response body

{
   "template":{
      "name":"Template 1",
      "description":"Template 1 description",
      "thumbnailPath":"https://api.treepodia.com/rest/vod/v032021/acc/UA-PERSOVIDDEMO/templates/111111111/thumbnail",
      "patameters":[
         {
            "id":"gender",
            "name":"Gender",
            "description":"Gender",
            "defaultValue":"Male",
            "values":[
               "Male",
               "Female"
            ],
            "type":"select"
         },
         {
            "id":"footage",
            "name":"Footage",
            "description":"Footage Video",
            "type":"video"
         },
         {
            "id":"birthDate",
            "name":"Birth Date",
            "description":"Birth Date",
            "type":"text"
         },
         {
            "id":"companyName",
            "name":"Company Name",
            "description":"Company Name",
            "type":"text"
         },
         {
            "id":"employeeName",
            "name":"Employee Name",
            "description":"Employee Name",
            "type":"text"
         },
         {
            "id":"companyLogo",
            "name":"Company Logo",
            "description":"Company Logo",
            "type":"image"
         }
      ]
   }
}

Video on demand request

The following service is for immediate video creation . Immediate video creation is available for a specific type of DynamicVideo templates, and these videos can only be played through the DynamicVideo player.

The video UUID returned from the response can be used by Dynamic Video Player to play the generated content.

Templates request usage example

Request URL: https://api.treepodia.com/rest/vod/v012024/acc/{uuid}/videos
Method: POST
Content Type: application/json
Body:
{
    "sku": "test26", 
    "template": 87687687786, 
    "temp" : false, // true - when video is temporary, for example on editor page, false - when creating final version. Temporary video is available for a short period of time(less than 24hours).
    "parameters": {
        "firstName": "Test", 
        "lastName": "Last"
    }
}

Successful response body

{
    "sku":  "test26", 
    "videoUUID":  "kjashida7asdjahgsdau6tsdas",
    "status": "COMPLETED"
}
Updated on February 1, 2024

Was this article helpful?

Related Articles