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":"[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
}

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/v032021/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}\”,\”status\”:\”{status}\”,\”errorMessage\”:\”{errorMessage}\”}”)

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

Request URL: http://api.treepodia.com/rest/vod/v032021/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}\",\"status\":\"{status}\",\"errorMessage\":\"{errorMessage}\"}"
    }
}

Successful response body

{ "id": 2, "status": "PENDING" }
Updated on February 23, 2022

Was this article helpful?

Related Articles