Skip to content

Instantly share code, notes, and snippets.

@ajsouza
Created September 10, 2011 21:11
Show Gist options
  • Save ajsouza/1208795 to your computer and use it in GitHub Desktop.
Save ajsouza/1208795 to your computer and use it in GitHub Desktop.
Executing RLC (Run Live Campaign) in OAS via PHP
<?php
class OASAPI{
public $api_wsdl = "";
public $api_account = "";
public $api_user = "";
public $api_pass = "";
private $wsdl;
function __construct($url){
$this->api_wsdl = $url;
}
function request($adxml){
try{
$client = new SoapClient($this->wsdl, array( 'connection_timeout' => 120, 'max_execution_time' => 120));
$return = $client->OASXmlRequest($this->api_account, $this->api_user, $this->api_pass, $adxml);
//--> Test for valid AdXML Return
return $return;
}
catch (Exception $e){
echo $e->getMessage();
return false;
}
}
function RLC($account){
$this->api_account = $account;
$adxml = "<AdXML><Request type=\"Campaign\"><Campaign action=\"run\"><RunLiveCampaigns/></Campaign></Request></AdXML>";
echo $this->request($adxml);
}
}
$OAS = new OASAPI('https://oas.[YOUR OAS ADDRESS].com/oasapi/OaxApi?wsdl');
$OAS->api_user = "USER";
$OAS->api_pass = "PASS";
$OAS->RLC("ACCOUNT");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment