CREATE BROADCAST SCHEDULE
Creates a new Schedule for a Broadcast
Broadcast can be set to run at scheduled times as prescribed by BroadcastSchedule. It allows setting start time, stop time, begin date, and day of week. It returns broadcastScheduleId that can be used in GetBroadcastSchedule and DeleteBroadcastSchedule.
REQUEST PARAMETERS
Parameter | Data type | Demo Value | Description |
---|---|---|---|
CreateBroadcastSchedule | object | Create BroadcastSchedule using attached info | |
RequestId | anyURI | ||
BroadcastId | long | ||
BroadcastSchedule | object | ||
Id | long | 1 | Unique ID of Broadcast Schedule |
StartTimeOfDay | time | 09:00:00 | Earliest time a client can be contacted in the timezone associated with the number's NPA/NXX |
StopTimeOfDay | time | 17:00:00 | Latest time a client can be contacted in the timezone associated with the number's NPA/NXX |
TimeZone | string | PST | Time Zone |
BeginDate | date | 2012-01-01 | Start date of Campaign |
EndDate | date | 2014-01-01 | End date of Campaign |
DaysOfWeek | List[DayOfWeek] | [SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY] |
RESPONSE PARAMETERS
Parameter | Data type | Description |
---|---|---|
CreatedId | long | Unique ID of resource |
EXAMPLE
using RestSharp;
namespace [your-namespace]
{
public class [your-class]
{
public string CreateBroadcastSchedule()
{
long broadcastId = 18; //Your Broadcast Id here
var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");
var request = new RestRequest(string.Format("broadcast/{0}/schedule",broadcastId), Method.POST);
request.AddParameter("StartTimeOfDay", "09:00:00");
request.AddParameter("StopTimeOfDay", "17:00:00");
request.AddParameter("TimeZone", "America/Los_Angeles");
request.AddParameter("StartTimeOfDay", "2013-03-06-08:00");
request.AddParameter("StopTimeOfDay", "2013-03-09-08:00");
var response = client.Execute(request);
string content = response.Content;
return content;
}
}
}
The XML returned is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<r:ResourceReference xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">
<r:Id>171125003</r:Id>
<r:Location>https://www.callfire.com/api/1.1/rest/broadcast/schedule/171125003</r:Location>
</r:ResourceReference>