COVERITLIVE API - EVENT/UPDATE (V. 2.0)

The Request

The Event Update method allows you to update event data once an event has been created. This version supports only preroll ad updates. Once set up you will be able to add preroll videos to your events (ads that run prior to a viewer gaining access to the content of the event). These updates are specific to an event, but can be called numerous times if you wish to change ad configuration during an event.

NOTE: This method is only available to users who have signed up for one of our Custom Plans. Please contact Customer Service for additional information.

URL:
https://api.coveritlive.com/remote/2/event/update
Response Format:
JSON
HTTP Method(s):
POST
API Rate Limited:
true
In addition to the parameters listed in the Request Parameters section, the event/update method also includes the following parameters:

Parameter Description Required
event_code The event code for the event for which data is being retreived. Each CiL event that is created is assigned a unique event code that identifies it in the database - The event owner can find this value after creating a new event, by selecting the "altcast_code" which is found in their Viewer Window embed code (e.g. the event code is "46e6cd22b5" in "altcast_code=46e6cd22b5"). This value is also returned by the event/list API method. yes
ad_type Type of ad to be displayed. Currently only supports the value: preroll yes
ad_code

A snippet of html code that displays the ad. Must be an iframe which calls a page on your own domain which contains the necessary code to run the ad. If left blank, it has the effect of removing custom ads from the event.

See Ad Code section for

no
close_button Determines if the ad will have a close button allowing the viewer to close the ad. The default is no closebutton. Valid values are 'y' and 'n'. no

Ad Code

In order to function correctly, the page called by the iframe must perform the following actions:

Start the ad. the page must call the startCustomAd.html file. The closebutton is optional, but can be used to override the setting provided when building the event.

Sample code for starting an ad:


// this method would be called from the onload event
function startAd() {
	var closebutton = "y";
	var i = document.createElement("iframe");
	i.style.display = "none";
	i.src = "http://cdnsl.coveritlive.com/startCustomAd.html?closebutton=" + closebutton;
	document.body.appendChild(i);
}

Close the ad. Ads can be removed using 2 methods:

  1. Include a close button and the user can remove the ad at any time. This is ideal for static image ads.
  2. Do not include a close button and have the page call the closeCustomAd.html file, which will close the ad for the viewer. Closing the ad using this method is ideal for video ads, which you may want the viewer to watch in their entirety before closing.

Sample code for closing an ad:


// this method would be called at the point in time you wish to close the ad
function closeAd() { 
	var i = document.createElement("iframe");
	i.style.display = "none";
	i.src = "http://cdnsl.coveritlive.com/closeCustomAd.html"
	document.body.appendChild(i);
}

The Response

There is no extra data returned from a event/update request, so the response has the same fields as a general response.

Example response to a successful content/create request:


{
	"result": "success",
	"message": "true",
	"type": "content",
	"action": "create",
	"version": 2
}

event/update Error Responses

A variety of error responses (in addition to the common error responses) to event/update requests, and instructions on how to rectify them:

result response message response solution
access_denied You do not have access to the event/update request. Access to this method is restricted to users who have contracted for an account with appropriate privledges. Contact Customer Service for additional information.
invalid_ad_type_param Required parameter empty: ad_type. The parameter ad_type is required. Adjust request to include this parameter.
invalid_ad_type_param Required parameter: ad_type must be - preroll You have passed an unsuported value for ad_type. Adjust request to use a supported value, currently only supports preroll