Introduction
The SundaySky API enables you to securely render and embed personalized videos in real time.
The API is used to POST data fields that you have set up in your data library (first name, customer type, etc.) to SundaySky's API endpoint. SundaySky then creates a video in real time and returns a base64 string as the response that can be used to play a personalized video for your viewers, using the SundaySky player. Alternatively, you can decode the base64 response and extract different components of the video (such as the video stream URL or captions file URL) and use those components with other video players. Note that when the video is played in a non-SundaySky player, SundaySky-specific functions such as clickable CTAs and analytics are not available.
After implementing this data connector, the SundaySky landing page builder cannot be used.
Embedding the Player Code
Before Starting: |
1. |
On the video page, click Share and then select Embed Video. |
||||||||||||
|
|||||||||||||
2. | Follow the steps as displayed on the screen. |
||||||||||||
|
Getting the API URL
In general, the SundaySky API uses HTTP POST requests with JSON arguments and JSON responses.
1. | POST URL |
https://apis.sundaysky.com/get-video/player-session/<Your SundaySky Video ID> | |
2. |
Request Body: a flat JSON object with attribute names and values. See Setting up Data Integration for a Video to learn how to retrieve the JSON field names required for your video. We recommend including a unique identifier as the value for the id field. This will enable you to accurately report on user video views. For example: |
{ "firstName": "Mitch", "customerType": "Platinum", "id": "6tifi6h76fd4t7dj48e7tr7" } |
|
3. |
Headers |
Mandatory Content-Type: application/json Optional—This enables the SundaySky platform to correctly determine the viewer's operating system, device type, and browser type. User-Agent: <user-agent value for the viewer> |
Response Codes
Code | Message | Description |
200 | OK | Video generation process was successful; base64 response is returned. |
30X (302, 307, etc.) | Temporary redirect | Request was redirected; see response location field for the redirect URL. |
40X (e.g. 407) | Forbidden | The request type is malformed or not supported. |
501 | Not implemented | Technical exception. See response body for details. |