ADDEDIT Campaign API Version 1

Updated on 2014-5-6
Current Version: Version 1
Deprecated Version: N/A
Requests Allowed: GET/SOAP

 

Summary:

Allows you to create or update campaign details in CAKE.

 

Resource/WSDL Page:

http://<your_domain_here>/api/1/addedit.asmx?op=Campaign

 

Parameters

api_key
Required
Type: STRING
Length (Max/Min): 50

This api_key will provide you with the ability to export Campaigns for your instance. You can obtain this api_key from within CAKE >> Setup >> Permissions in the API Key list.

Example Values: 

Fo35NRAqvFLXoZxqB4aViaiYM7iVMhh

campaign_id
Required
Type: INTEGER
Length (Max/Min): N/A

This is the identifier for a unique campaign. 0 adds a new campaign, any value >0 will edit the campaign with that ID.

You can obtain the campaign ID from your CAKE instance on the campaign card.

Example Values: 0 or 1234

affiliate_id
Required
Type: INTEGER
Length (Max/Min): N/A

This is the identifier for a unique Affiliate.  This can be found on any Affiliate card.

Example Values: 1234

offer_id
Optional
Type: INTEGER
Length (Max/Min): N/A

This is the identifier for a unique Offer.  This can be found on any Offer card.

Either offer_id or offer_contract is required

Example Values: 1234

 

offer_contract_id
Optional
Type: INTEGER
Length (Max/Min): N/A

This is the identifier for a unique Offer Contract ID.

Either offer_id or offer_contract is required

Example Values: 1234

media_type_id
Required
Type: INTEGER
Length (Max/Min): N/A

Must pass at least >= 0 as value. Used to filter records matching the value or will return all records if <=0.

Example Values: 1234

third_party_name
Required
Type: STRING
Length (Max/Min): 50

Third party name associated with an offer.

Empty sets to null in the database

Example Values: Third Party

 

account_status_id
Optional
Type: BYTE
Length (Max/Min): N/A

Identifier for the status of the campaign.

Required on creation, 0 to skip on edit

 

 

currency_id
Optional
Type: INTEGER
Length (Max/Min): N/A

Identifier for the currency used on the campaign, only used if currencies are enabled.

0 to skip

Example Values: 1

payout
Required
Type: DECIMAL
Length (Max/Min): N/A

Payout for the campaign

Example Values: 1.40

 

paid_redirects
Required
Type: BOOL
Length (Max/Min): N/A

Are paid redirects used?

Example Values: TRUE

clear_session_on_conversion
Required
Type: BOOL
Length (Max/Min): N/A

Clear the session (or not) when an conversion occurs.

Example Values: TRUE

postback_url
Optional
Type: STRING
Length (Max/Min): 400

URL to be used for the postback for the campaign.

Example Values: http://postbackurl.com

postback_delay_ms
Optional
Type: INTEGER
Length (Max/Min): N/A

Delay to be used for triggering the postback call (in milliseconds).

Required on creation, < 0 to skip on edit

Example Values: 30

pixel_html
Optional
Type: STRING
Length (Max/Min): N/A

Sets affiliate's pixel for campaign.

 

test_link
Optional
Type: STRING
Length (Max/Min): 400

Allows affiliates to send test clicks through their own link and then redirects to their unique CAKE link.

 **Note all optional parameters still need to be passed through in the actual call. These parameters do not need a value (therefore you can use a null value). 

 

Example Request

GET

http://demo.cakemarketing.com/api/1/addedit.asmx/Campaign?
api_key=dNJFmId9rI&campaign_id=3571&affiliate_id=0&offer_id=0
&offer_contract_id=0&media_type_id=15&third_party_name=Andy+Campaign
&account_status_id=1&currency_id=1&payout=2.25&paid_redirects=TRUE
&clear_session_on_conversion=FALSE&postback_url=http://getCAKE.com/postback
&postback_delay_ms=60000
&pixel_html=%3Ciframe%20src%3D%22http%3A%2F%2Fandytrk.getCAKE.com
%2Fp.ashx%3Fo%3D455%26t%3DTRANSACTION_ID%22%20height%3D%221%
22%20width%3D%221%22%20frameborder%3D%220%22%3E%3C%2Fiframe%3E
&test_link=http://getCAKE.com

 

Sample XML Response:

<campaign_addedit_response>
   <success>true</success>
   <message>Campaign Updated</message>
   <success_info>
      <campaign_id>3571</campaign_id>
      <affiliate_id>-1</affiliate_id>
      <offer_id>1000042</offer_id>
      <offer_contract_id>647</offer_contract_id>
      <media_type_id>15</media_type_id>
      <original>true</original>
   </success_info>
</campaign_addedit_response>

 

Example Error Messages: 

Error Message

Likely Cause

Invalid API Key

API key does not exist or is expired.

Invalid Affiliate

no affiliates were found in the database for the specified affiliate_id

Offer or Offer Contract Required

offer_id and offer_contract_id is less than or equal to 0

Invalid Offer

no offer found for the specified offer_id that has a default offer contract

Invalid Currency

currencies is enabled for the client and no curreny was found for the currency_id

Invalid Campaign ID

no campaign found for the specified campaign_id

Invalid Offer Contract

offer_contract_id doesn't match an offer contract in the database for the specified price_format_id or the specified offer_id

Invalid Media Type

media_type_id doesn't match a media type in the database

Invalid Account Status

account_status_id doesn't match an account status in the database