Created
September 10, 2011 21:11
-
-
Save ajsouza/1208795 to your computer and use it in GitHub Desktop.
Executing RLC (Run Live Campaign) in OAS via PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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