1. Home
  2. API's
  3. Video On Demand API

Video On Demand API

Video on demand API allow you to create videos using the Treepodia engine without the need for data-feed

Authentication

Every API request must be authorized by attaching an access token to it. The following service provides access token generation

Auth request usage example

Request URL: http://api.treepodia.com/rest/vod/v032021/auth
Method: POST
Content Type: application/json
Body:
{
   "email":"test@email.com",
   "password":"123456"
}

Successful response body

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

VOD Request

Every API request must be authorized by attaching an access token to it. The following service provides access token generation

  • Send a POST request to https://api.treepodia.com/rest/vod/v032016/acc/{uuid}/requests
    REPLACE {UUID} IN THE URL WITH YOUR ACTUAL TREEPODIA UUID
  • Use “application/json” as content type for your request
  • The body of the request MUST have the following fields:
    1. accessToken – STRING
    2. sku – STRING
    3. templateId = INT
    4. requestData – OBJECT
      This object holds the data the template needs to create the video
      • templatefield1
      • templatefield2
      • templatefield3
    5. callback – OBJECT
      This object holds the content for the callback when the video is ready
      • url – STRING
      • method – STRING (“POST”)
      • contentType – STRING (“application/json”)
      • body – STRING (“{\”requestId\”:\”{requestId}\”,\”videoUrl\”:\”{videoUrl}\”})

Auth request usage example. Where <<UUID>> should be replaced with your UUID

Request URL: http://api.treepodia.com/rest/vod/v032016/acc/<<UUID>>/requests
Method: POST
Content Type: application/json
Body:
{
    "accessToken": "aefc18c8-7bb0-41e2-a855-xxxxxxxxxxxxxx",
    "sku": "test25",
    "templateId": 0,
    "requestData": {
        "firstName": "Test",
        "lastName": "Last"
    },
    "callback": {
        "url": "https://yourdomain.com/vodcallback",
        "method": "POST",
        "contentType": "application/json",
        "body": "{\"requestId\":\"{requestId}\",\"videoUrl\":\"{videoUrl}\"}",
    }
}

Successful response body

{ "id": 2, "status": "PENDING" }
Updated on September 13, 2021

Was this article helpful?

Related Articles