Skip to content
English - United Kingdom
  • There are no suggestions because the search field is empty.

How to Use Webhook Parameters in Interactive Videos

A Guide to Using Webhook Data in Cinema8 Interactive Video

It is possible to access values inside objects through webhooks. Let's examine how we can extract values from objects and use them in the video with a webhook.

Let's assume there is an object in the URL where we will export data to Cinema8 via webhook:

{
  score: 85,
  user: {
     firstName: "John",
     lastName: "Doe",
     userName: "john.doe"
    }
}

 

Now, let's use values like "firstName", "lastName", and "userName" in the video through a webhook. First, add the HTML element that will display these values on the video (click to learn how to add the HTML element to the video). Then, add the following code to the HTML element to show the contents of "firstName", "lastName", and "userName" in the video:

Cinema8 Articles - How to Use Webhook Parameters in Interactive Videos 1

 

Then, run the video using the "Preview" button and check what happens.

Cinema8 Articles - How to Use Webhook Parameters in Interactive Videos 2

 

That's it! You've learned how to display values from objects using the HTML widget on video via webhook. Now, let's quickly show this data on the video with the "Conditional Action" element.

First, add the "Conditional Action" element to your video. (Click to learn how to add the conditional element to the video). Press the "Add Condition" button and enter the following code:

"user.username = john.doe"

 

The "user" here refers to the object name in the webhook, from which the data will be extracted. "Username" is the name of the data field in the object.

Cinema8 Articles - How to Use Webhook Parameters in Interactive Videos 3

 

A "Conditional Action" set up this way will only work if the webhook data exchange is successful.