post https://api.pictory.ai/pictoryapis/v1/video/from-template
This API is used to update variables in the template and generate Video Preview
Creating and Updating Variables in .pictai Files for Personalized Videos
To generate personalized videos using the .pictai
file, you can define and update variables through the API. Follow these steps to create and utilize variables:
- Create a Variable in the .pictai File:
Use the {{ ... }} tag to create a variable within your .pictai file.
For example, to create a variable named customer_name, include {{ customer_name }} in your .pictai file. - Update the Variable via the API:
Assign the value to the variable in thevariables
parameter of the API. Here's an example of how to set the variable customer_name to "Mark Vaughen":- Create a variable in your
.pictai
file by using{{ ..}}
tag. - For example, if you mention
{{ customer_name }}
in the.pictai
file then a variable with namecustomer_name
is created. :
- Create a variable in your
"variables" : {
"customer_name" :" Mark Vaughen"
}
- Modify Scene Object
To change the background scene URL or to change the entire scene object pass the sceneId
along with the scene parameters which needs modification
// sample scene object
"scenes": [
{
"sceneId": "20240618070751211ijVMSfbuojRA4ZP",
"subtitles": [
{
"text": "THE SUBTITLE TEXT WHICH NEEDS TO BE REPLACED FOR THIS SCENE"
}
],
"backgroundVisual": {
"visualUrl": "BACKGROUND_SCENE_URL",
"type": "video"
}
}],
- Video Preview:
The GET job API will return the video preview URL showing the scene with the actual customer's name.
Following these steps, you can easily create and update variables to generate personalized video content.