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.

bell-on.png  After implementing this data connector, the SundaySky landing page builder cannot be used.


Embedding the Player Code

Before Starting:
Make sure that the video is published.

 
1.

On the Video Page, click Share and then select Embed Video.
▶ If you have not yet created the code snippet, the option name is Create Embed Video.

2.

(Optional) If you have not yet created the code snippet, follow steps 3-4 in Generating the Embed Code.

3. Follow the steps as displayed on the screen.
 
a. Copy and paste the player embed code snippet, placing the div element (sskydiv) where you want the player to appear.
  Copy_code_new.png

b. Click Copy to copy the POST URL and populate the request body according to the guidelines below.
  step_2_new.png

c. In the code snippet, replace **Base64 response from Video API** with the API response.
  Base_64_response_new.png

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.
Was this article helpful?
0 out of 0 found this helpful

Still Have Questions?

SundaySky Support is here for you

contact support