Video-on-Demand API allows other companies to integrate with Treepodia’s services.
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: https://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
}
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/v032021/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/v032021/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 with immediate response
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/v032021/acc/{uuid}/videos
Method: POST
Content Type: application/json
Body:
{
"accessToken": "aefc18c8-7bb0-41e2-a855-xxxxxxxxxxxxxx",
"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"
}