var result = ws.requestCampaign(ai, new Marketo.ParamsRequestCampaign()
{
campaignId = campaign,
campaignIdSpecified = true,
source = Marketo.ReqCampSourceType.MKTOWS,
leadList = new Marketo.LeadKey[]{new Marketo.LeadKey()
{
keyType = Marketo.LeadKeyRef.IDNUM,
keyValue = lead.Id.ToString()
},
},
programTokenList = new Marketo.Attrib[] {
new Marketo.Attrib() { name="EmailLinkUrl", value="http://staging.windstreambusiness.com/download?url=somefile"}
}
});
public function testRequestCampaignOverrideTokens()
{
$key = new LeadKey();
$key->keyType = "EMAIL";
$key->keyValue = "aahsan99@gmail.com";
$key2 = new LeadKey();
$key2->keyType = "EMAIL";
$key2->keyValue = "agha@marketo.com";
$leads = array();
$leads[] = $key;
$leads[] = $key2;
$leadList = new ArrayOfLeadKey();
$leadList->leadKey = $leads;
$tokens = array();
// The {{ }} are optional, but 'my.' is required
$tokens[] = new Attrib("{{my.Offer Start}}","1/1/2013");
$tokens[] = new Attrib("{{my.Offer End}}","10/1/2013");
$tokenList = new ArrayOfAttrib($tokens);
$params = new paramsRequestCampaign();
$params->source = "MKTOWS";
$params->campaignName = "My Cool Campaign";
$params->programName = "Winter 2013";
$params->programTokenList = $tokenList;
$params->leadList = $leadList;
$authHdr = apiClientUtil::getAuthenticationHeader(self::$wsUser, null, null, $params);
$client = $this->getSoapClient();
$success = $client->__soapCall('requestCampaign', array($params), null, $authHdr);
$this->assertNotNull($success, 'Response is null');
$this->assertNotNull($success->result, 'Result in response is null');
$this->assertTrue($success->result->success, 'API failure reported');
}