Create and get a Vidata Batch (the API way)

Get your API key

To generate a batch of Vidatas, you will need an API key, and the Id of your project. In our Platform, go into your Account , in the Token pannel, you will be able to manage your API tokens and get a API Key.

Your project ID will be sent to you by a Vidata administrator as soon as the project is created.

Exemple
                        
7988fb58-4730-4bf8-8f89-efe8b632a820
                        
                    

Find the variables of your project

Each project is associated with a video and has a list of variables for which a customization will need to be sent.
You can use the API to retrieve them, using the query:

                
GET https://api.vidata.io/v1/video/{video_id}/variables
                    
                

Sample query

GET https://api.vidata.io/v1/video/95d0224d-fc6f-4b55-88bf-a3e1c4400cf2/variables

Reply to your request

                
{
    "Texts":
    [
      {
"ExampleValue": "Matthieu Rogier;",
"MaxLength": "100;",
"Name": "TXT_NAME;",
"DefaultValue": "Matthieu Rogier;",
{
"ExampleValue": "Métrologue;",
"MaxLength": "100;",
"Name": "TXT_METIER;",
"DefaultValue": "Métrologue;",
], "Images": [ ], "Videos": [ ] }

Create a Vidata batch

Now that you have your API key, the project Id, and the list of variables, you can write your query. For each Vidata in the batch, you need to send a Customization, i.e. an object containing the video variables, and their value.

                
POST https://api.vidata.io/v1/vidata/batch?vkey=[API_KEY]
                    
                
Informations
                    
When you create your customizations dictionary, you can add
a field TXT_USEREMAIL to link the generated video to a unique email.
                        
                    

Sample query

POST https://api.vidata.io/v1/vidata/batch?vkey=[API_KEY]

                    
{
ProjectKey: "7988fb58-4730-4bf8-8f89-efe8b632a820",
Customizations: [
{
  "TXT_USEREMAIL" : "user1@mail.com",
  "TXT_NAME": "Matthieu Rogier",
  "TXT_METIER": "Métrologue",
},
{
  "TXT_USEREMAIL" : "user2@mail.com",
  "TXT_NAME": "Matthieu Rogier",
  "TXT_METIER": "Métrologue",
}
]
}
}
                    
                

Response

If the request is valid, the API will respond with an HTTP 201 Created status, and will return a batchId .

                    
{
"batchId" : "c706af5f-27ac-407e-bc58-4541869cc69b"
}
                        
                    

Callback

On completion, the batch can send a callback and ping a specified url to let you know all the vidatas have been generated.

You can add an optional CompletionCallbackUrl parameter, along with the url you would like to use, as shown below

                    
{
"ProjectKey": "string",
"Customizations": [
{
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
],
"CompletionCallbackUrl": "string"
}
                    
                    

Retrieve the batch status

Once you have a batchId, you can request its status and see the progress of the generation with the following query.

                
POST https://api.vidata.io/v1/vidata/batch/{batchId}?vkey=[API_KEY]
                    
                

Sample query

GET https://api.vidata.io/v1/vidata/batch/{batchId}?vkey=[API_KEY]

                    
{
"status" : "Completed"
}
                        
                

The possible values for the status are:

  • Pending: The batch has not started yet
  • Running: The videos are being generated
  • Completed: All the videos have been generated, and a report is ready

A callback feature is currently being developped to let you know when the batch is completed

Export the batch output

When the batch is completed, you can export the result through the 2 following query.

For a result in JSON:
                
POST https://api.vidata.io/v1/vidata/batch/{batchId}/export?vkey=[API_KEY]
                    
                
Or in CSV:
                
POST https://api.vidata.io/v1/vidata/batch/{batchId}/export/csv?vkey=[API_KEY]
                    
                

The result with return a list of all the Vidata created, along with the variables used and some additional information (mp4 url, cover url and vidata id)

Découvrez les avantages de la Vidéo Personnalisée

Un conseiller vous présentera en détail la Solution Vidata pour augmenter
la rentabilité de vos actions marketing et fidéliser vos clients.

Nous contacter