Enable Ad Insertion
Creates the ad insertion record for the VoD pull zone. Requires the service to have Advanced Features enabled and an available ad insertion slot.
curl -X PUT "https://api.5centscdn.com/v2/zones/vod/pull/42/adinsertion" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"enabled": "Y",
"provider": "Google Ad Manager",
"advanced_analytics": 1,
"assetSample": "/videos/sample-content.mp4"
}'
import requests
import json
url = "https://api.5centscdn.com/v2/zones/vod/pull/42/adinsertion"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"enabled": "Y",
"provider": "Google Ad Manager",
"advanced_analytics": 1,
"assetSample": "/videos/sample-content.mp4"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/zones/vod/pull/42/adinsertion", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"enabled": "Y",
"provider": "Google Ad Manager",
"advanced_analytics": 1,
"assetSample": "/videos/sample-content.mp4"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"enabled": "Y",
"provider": "Google Ad Manager",
"advanced_analytics": 1,
"assetSample": "/videos/sample-content.mp4"
}`)
req, err := http.NewRequest("PUT", "https://api.5centscdn.com/v2/zones/vod/pull/42/adinsertion", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.5centscdn.com/v2/zones/vod/pull/42/adinsertion')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"enabled": "Y",
"provider": "Google Ad Manager",
"advanced_analytics": 1,
"assetSample": "/videos/sample-content.mp4"
}'
response = http.request(request)
puts response.body
{
"result": "success"
}
/zones/vod/pull/{zoneid}/adinsertionTarget server for requests. Edit to use your own host.
API key (sent in header)
Zone ID
The media type of the request body
Enable or disable ad insertion on the zone.
Ad server provider identifier.
1 to enable the Advanced Analytics add-on, which unlocks the Ad Insertion Logs tab and the Advanced Analytics tab (tracking reports, creatives, events, ad breaks). 0 otherwise.
Relative path to an existing VoD file on the zone's origin, used to verify SSAI reachability. Required the first time ad insertion is enabled on a pull zone; ignored afterwards.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Path Parameters
Body
1 to enable the Advanced Analytics add-on, which unlocks the Ad Insertion Logs tab and the Advanced Analytics tab (tracking reports, creatives, events, ad breaks). 0 otherwise.
01Relative path to an existing VoD file on the zone's origin, used to verify SSAI reachability. Required the first time ad insertion is enabled on a pull zone; ignored afterwards.
/videos/sample-content.mp4Responses
successerror