Fetch Entry API Integration Guide
Overview
This integration guide aims to help developers understand how to adhere to the Applicaster Fetch API Protocol in order to fulfill the following requirements:
- Provide personalized ads
- Fetch entry-specific DRM content
- Fetch platform-specific video source (HLS, MPD, etc)
- Verify user entitlements and return the entry data with the stream source URL in case the user has entitlements
- Providing additional information to an entry before playing content.
By following this guide, developers can create a streamlined user experience within the Applicaster app, ensuring video content is appropriately personalized, protected, and accessed only by authorized users.
Adhering to the Applicaster Fetch API Protocol
To adhere to the Applicaster Fetch API Protocol, you need to implement an API that provides a response in the format specified by the Applicaster JSON Feed Protocol. Your API should return only one entry inside the feed for the Fetch Entry function.
Step 1: Define the API Endpoint
Create an API endpoint (e.g., /fetch-entry) to handle the Fetch Entry requests.
Step 2: Implement the API Logic
Implement the logic to handle the request by retrieving the specific information about an entry, such as personalized ads, entry-specific DRM content, and user entitlement verification. The response should follow the Applicaster JSON Feed Protocol, including only one entry inside the feed.
Step 3: Create the JSON Response
Construct the JSON response according to the Applicaster JSON Feed Protocol. The response should include an array with a single entry with the required information, such as media groups, DRM key systems, and user entitlements.
For example:
{
"id": "560e97d0-bbbf-496e-8b9b-ac363d311167",
"type": {
"value": "feed"
},
"title": "Featured Episodes",
"entry": [
{
"type": {
"value": "video"
},
"id": "296bed86-11dc-43c3-9aaf-bfb25600ad2a",
"title": "Big Brother E1 S1",
"summary": "Pilot episode",
"content": {
"src": "https://sample-video.com/pe.m3u8",
"type": "video/hls"
},
"media_group": [
{
"type": "image",
"media_item": [
{
"src": "https://example.com/images/big-brother-thumb.png",
"key": "thumbnail-16x9"
},
{
"src": "https://example.com/images/big-brother-thumb.png",
"key": "hero-4x3"
}
]
}
],
"extensions": {
"video_ads": "https://pubads.g.doubleclick.net/example/ads?sz= 640x480&iu=/123/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpod&cmsid=496&vid=short_onecue&correlator=",
"drm": {
"widevine": {
"license_url": "https://sample-drm-license-server.com"
},
"fairplay": {
"certificate_url": "https://sample-drm-server.com",
"license_server_url": "https://sample-drm-license-server.com",
"license_server_request_content_type": "application/json"
}
}
}
}
]
}
For a failed request:
HTTP/1.1 403 Forbidden
{
"statusText": "Unauthorized Request",
"status": 403,
}
Step 4: Add Entry Link to the Origin Feed
According to the Applicaster JSON Feed Protocol, the link
object should be included in the origin feed to provide additional information about the entry. This can include information such as the entry's canonical URL or a URL to access the entry's metadata.
To add the link object to your feed response, include it in the entry object as shown below:
Sample response with link object:
{
"feed": {
"title": "Sample Video Feed",
"entry": [
{
"id": "sample-video-id",
"title": "Sample Video",
"link": {
"rel": "self",
"href": "https://sample-entry-metadata-url.com/media/sample-video-id"
}
// ... additional data
}
]
}
}
Integration with the Applicaster App
After implementing your API to adhere to the Applicaster Fetch API Protocol, configure the Video Preload Plugin within your Applicaster app with the necessary settings, including the API endpoint for the Fetch Entry function.
Test the integration by playing a video within the Applicaster app. The Video Preload Plugin should fetch the entry-specific information.
For more information on implementing the Video Preload Plugin and configuring your Applicaster app, please refer to the Applicaster Documentation.