# Schedules store

API call format

POST /broker/schedules				//Use token autorization
POST /broker/private/schedules		//Use Api Key

Description

This call creates a single or multiple schedules.

Precondition

  • Authorization token/Api key is needed.
  • Mandatory elements (should be specified):
    • "shcedules:start" - valid Unix timestamp <schedule_start_timestamp>. Should be defined in the future > current time.
    • "shcedules:guid" - valid source ad point <source_guid>. Take a specific source point using Vod Metadata API call.
    • "shcedules:type" - valid source type. Usually 'source'.
    • "shcedules:ads:start" - valid source guid with ad points <source_guid>. Take a specific source guid and it's points using Vod Metadata API call.
    • "shcedules:ads:guid" - valid source guid. Take a specific source guid using Sources List API call.
    • "channel" - valid channel guid <channel_guid>.
    • "start" - valid Unix timestamp <channel_start_timestamp>. Should be equal to the first source 'start' timestamp.
    • "end" - valid Unix timestamp. This timestamp is calculated by adding to start timestamp duration of the source and duration of the advertisment.
      <channel_end_timestamp> = <schedule_start_timestamp>" + <source_duration> + <ad_duration>
  • Not mandatory (optional):
    • "shcedules:substitute" - schedule ad server link.
    • "shcedules:ads:substitute" - schedule ad server link.

Postcondition

  • On success response code should be 200
  • On success message for successful creation in JSON format is returned.
  • On failure an error will be returned with the right error code and description.

Example:

[Request] POST https://<base_api_url>/broker/schedules
[Request] POST https://<base_api_url>/broker/private/schedules
{
	"schedules": 
	[
		{
			"ads": 
			[
				{
					"start": "<source_ad_point>",
					"guid": "<ad_guid>",
					"substitute": 0
				}
			],

			"start": "<schedule_start_timestamp>",  //current_timestamp + 20 * 60 * 1000 (units in ms) - we hahe 20 min after
			"guid": "<source_guid>",
			"type": "source",
			"substitute": 0
		}
	],

	"channel": "<channel_guid>",
	"start": "<channel_start_timestamp>",            //<channel_start_timestamp> === <schedule_start_timestamp>
	"end": "<channel_end_timestamp>"				 //<channel_end_timestamp> = <schedule_start_timestamp>" + <source_duration> + <ad_duration>
}
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","Authorization":"<IdToken>"} //Use token autorization
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","X-Api-Key":"<api_key>"}     //Use Api Key

[Response] 201
[Response Headers] {"Content-Type":["application/json"],"Content-Length":["..."],"Connection":["keep-alive"],"Date":["..... GMT"],"x-amzn-RequestId":["....."],....]}
[Response] 
{
    "status":true,
    "data":"Item was created successfully"
}