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:
Then, run the video using the "Preview" button and check what happens.
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:
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.
A "Conditional Action" set up this way will only work if the webhook data exchange is successful.