Scheduler service

Contents

Scheduler Service

Description

This service provides you with the ability to schedule your campaigns and also download the campaign statistics.

WSDL

The list service allows you to . The WSDL for which is available here: Scheduler Service WSDL.


Methods

deleteCampaignSchedule

Use this function to to unschedule a previously scheduled campaign.

   Parameters
   * key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
   * scheduleId - This is the id of the campaign which you want to unschedule.
Example Request
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <tnsa:deleteCampaignSchedule xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tnsa:key>string</tnsa:key>
      <tnsa:scheduleId>-3612</tnsa:scheduleId>
    </tnsa:deleteCampaignSchedule>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Example Response

Sample PHP Code
	public function deleteCampaignSchedule($api_key,$scid,$debug)
	{
		$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SchedulerService?wsdl';
		$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
		$delcampaign = array(
   		'key' => $api_key,
   		'scheduleId' => $scid
		);
		try
		{
			$deleteCampaignScheduleResponse = $campaignOutboundClient->deleteCampaignSchedule($delcampaign);
			if($debug)
			{
				echo "Campaign Unscheduled.";
			}
		}
		catch(SoapFault $error)
		{
			if($debug)
			{
				echo $error."<br/>";
			}
		}
	}
Sample C# Code
        public void deleteCampaignSchedule(string key,long scheduleId)
        {
            //LOG.Info("Entered deleteCampaignSchedule(string key,long scheduleId)");
            try
            {
                this.schedulerService.deleteCampaignSchedule(key, scheduleId);
            }
            catch (Exception e)
            {
                string msg = "Unable to deleteCampaignSchedule";
                LOG.Error(msg);
                throw new SchedulerServiceException(msg, e);
            }
            finally
            {
                //LOG.Info("Exited deleteCampaignSchedule(string key,long scheduleId)");
            }
        }

getNewCampaignSchedule

Use this function to get the details/(campaign schedule details) of a newly created campaign.

   Parameters
   * key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
   * campaignid - This is the campaign id for which you want to get the schedule.


Example Request
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <tnsa:getNewCampaignSchedule xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tnsa:key>string</tnsa:key>
      <tnsa:campaignid>-1673</tnsa:campaignid>
    </tnsa:getNewCampaignSchedule>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Example Response

Sample PHP Code
	public function getNewCampaignSchedule($api_key,$campaignId,$debug)
	{
		$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SchedulerService?wsdl';
		$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
		$createcampaign = array(
   		'key' => $api_key,
   		'campaignid' => $campaignId
		);
		try
		{
			$getNewCampaignScheduleResponse = $campaignOutboundClient->getNewCampaignSchedule($createcampaign);
			$schedule = $getNewCampaignScheduleResponse->out;
			if($debug)
			{
				echo "<table border=1><tr><td>campaign</td><td>id</td><td>job</td><td>often</td><td>startDayOfWeekGMT</td><td>startDayOfYear</td><td>startHourGMT</td><td>startMinuteGMT</td><td>startYear</td><td>startYet</td><td>stopDayOfYear</td><td>stopYear</td><td>stopYet</td><td>timezone</td><td>userEnteredStartDay</td><td>userEnteredStartTime</td><td>userEnteredStopTime</td><td>userId</td></tr>";
				foreach($schedule->NewCampaignScheduleType as $line)
				{
					echo "<tr>";
					echo "<td>".$line->campaign."</td>";
					echo "<td>".$line->id."</td>";
					echo "<td>".$line->job."</td>";
					echo "<td>".$line->often."</td>";
					echo "<td>".$line->startDayOfWeekGMT."</td>";
					echo "<td>".$line->startDayOfYear."</td>";
					echo "<td>".$line->startHourGMT."</td>";
					echo "<td>".$line->startMinuteGMT."</td>";
					echo "<td>".$line->startYear."</td>";
					echo "<td>".$line->startYet."</td>";
					echo "<td>".$line->stopDayOfYear."</td>";
					echo "<td>".$line->stopYear."</td>";
					echo "<td>".$line->stopYet."</td>";
					echo "<td>".$line->timezone."</td>";
					echo "<td>".$line->userEnteredStartDay."</td>";
					echo "<td>".$line->userEnteredStartTime."</td>";
					echo "<td>".$line->userEnteredStopTime."</td>";
					echo "<td>".$line->userId."</td>";
					echo "</tr>";
				}
				echo "</table>";
				//print_r($schedule);
			}
		}
		catch(SoapFault $error)
		{
			if($debug)
			{
				echo $error."<br/>";
			}
		}
	}
Sample C# Code
        public NewCampaignScheduleType[] getNewCampaignSchedule(string key, long campaignid)
        {
            //LOG.Info("Entered NewCampaignScheduleType getNewCampaignSchedule(string key, long campaignid)");
            try
            {
                NewCampaignScheduleType[] campaignSchedule = this.schedulerService.getNewCampaignSchedule(key,campaignid);
                return campaignSchedule;
            }
            catch (Exception e)
            {
                string msg = "Unable to getNewCampaignSchedule";
                LOG.Error(msg);
                throw new SchedulerServiceException(msg, e);
            }
            finally
            {
                //LOG.Info("Exited NewCampaignScheduleType getNewCampaignSchedule(string key, long campaignid)");
            }
        }

scheduleCampaignWithDateStrings

Use this function to schedule a campaign on a particular date & time.

   Parameters
   * key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
   * campid - This is id of the campaign which you want to schedule
   * startDateTimeString - This is date & time when you want to start the campaign. (eg. 2010-06-03 15:37:18)
   * stopDateTimeString - This is the date & time when you want to stop the campaign. (eg. 2010-06-03 15:39:18)
   * timezone - Enter the timezone (eg. PST)

Time zone strings can be "HST", "AKST", "PST", "MST", "CST", "EST", "AST",

The date strings should be in the format:

yyyy-MM-dd HH:mm:ss

HH is military hours, timezone is seperate, and if you wish to not have a stopTime then leave it an empty string or null.

Example Request
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <tnsa:scheduleCampaignWithDateStrings xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tnsa:key>string</tnsa:key>
      <tnsa:campid>6919</tnsa:campid>
      <tnsa:startDateTimeString>2009-04-15 18:00:00</tnsa:startDateTimeString>
      <!-- If campaigns needs to run until finished, change to null or empty string -->
      <tnsa:stopDateTimeString>2009-04-15 21:00:00</tnsa:stopDateTimeString>
      <!-- Look at documentation for acceptable time zones -->
      <tnsa:timezone>PST</tnsa:timezone>
    </tnsa:scheduleCampaignWithDateStrings>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Example Response

Sample PHP Code
	public function scheduleCampaignWithDateStrings($api_key,$campid,$startDateTimestring,$stopDateTimestring,$timezone,$debug)
	{
		$createOtboundcampaignWsdl = 'http://www.callfire.com/service/SchedulerService?wsdl';
		$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
		$schedulecampaignParams = array(
   		'key' => $api_key,
   		'campid' => $campid,
		'startDateTimeString' => $startDateTimestring,
		'stopDateTimeString' => $stopDateTimestring,
		'timezone' => $timezone
		);
		try
		{
			$schedulecampaignResponse = $campaignOutboundClient->scheduleCampaignWithDateStrings($schedulecampaignParams);
			$scheduleid = $schedulecampaignResponse->out;
			if($debug)
			{
				echo "Schedule ID :: ".$scheduleid;
			}
		}
		catch(SoapFault $error)
		{
			if($debug)
			{
				echo $error."<br/>";
			}
		}
	}
Sample C# Code
        public long scheduleCampaignWithDateStrings(string key,long campid,string startDateTimeString,string stopDateTimeString,string timezone)
        {
            //LOG.Info("Entered scheduleCampaignWithDateStrings(string key,long campid,string startDateTimeString,string stopDateTimeString,string timezone)");
            try
            {
                long campaignId = this.schedulerService.scheduleCampaignWithDateStrings(key, campid, startDateTimeString, stopDateTimeString, timezone);
                return campaignId;
            }
            catch (Exception e)
            {
                string msg = "Unable to scheduleCampaignWithDateStrings";
                LOG.Error(msg);
                throw new SchedulerServiceException(msg, e);
            }
            finally
            {
                //LOG.Info("Exited scheduleCampaignWithDateStrings(string key,long campid,string startDateTimeString,string stopDateTimeString,string timezone)");
            }
        }