ADDEDIT Campaign API Version 3

Updated on 2014-11-10
Current Version: Version
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/3/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.

Obtained via EXPORT Campaigns API

Example Values: 0 or 1234

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

This is the identifier for a unique Affiliate.  Obtained via EXPORT Affiliates API

Example Values: 1234

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

This is the identifier for a unique Offer.  Obtained via EXPORT Offers API


Example Values: 1234
 

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

This is the identifier for a unique Offer Contract ID. Obtained via EXPORT Offers API

Pass 0 to use the default Offer Contract

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

Must pass at least >= 0 as value.

Obtained via GET MediaTypes API

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

Empty sets to null in the database

Example Values: Third Party

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

Identifier for the status of the campaign. Obtained via GET AccountStatuses API

Required on creation, 0 to skip on edit

Example Values: 

 
display_link_type_id
Required
Type: BYTE
Length (Max/Min): N/A

Obtained via GET LinkTypes API


Example Values: 1

expiration_date
Required
Type: DATETIME
Length (Max/Min): N/A

Sets expiration date for campaign. Must pass a date. Pass do_not_change for expiration_date_modification_type below to not set the date

Example Value: 1/1/2016

expiration_date_modification_type
Required
Type: DATETIME
Length (Max/Min): N/A

Used in conjunction with expiration_date above


Example Values: do_not_change, change, or remove.

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

Identifier for the currency used on the campaign, only used if currencies are enabled. Obtained via GET Currencies API

0 to skip

Example Values: 1
use_offer_contract_payout
Required
Type: ENUMERATION
Length (Max/Min): N/A


Example Values: on, off, or no_change

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

Payout for the campaign

Example Values: 1.40

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

Example Values: do_not_change, change, or remove

paid
Required
Type: ENUM
Length (Max/Min): N/A

Allows conversions/leads to result in payment and pixel fire for affiliate

Example Values: on, off, or no_change

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

Required, only used if global setting is enabled

Example Values: 0

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

Are paid redirects used?

Example Values: on, off, or no_change
paid_upsells
Required
Type: ENUMERATION
Length (Max/Min): N/A

Will any upsell offer conversions be credited to the affiliate?

Example Values: on, off, or no_change

Review
Required
Type: ENUMERATION
Length (Max/Min): N/A

Used in conjunction with Pending Conversions global setting

Example Values: on, off, or no_change

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

The amount of time before a pending conversion is automatically moved to accepted/rejected status (based on settings). -1 to skip

Example Values: 1

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

Offer contract id for campaign level redirect. Obtained via EXPORT Offers API

0 to skip

redirect_404
Required
Type: ENUMERATION
Length (Max/Min): N/A

Redirect traffic to a 404 when a cap is hit or other redirect event occurs.

Example Values: on, off, or no_change

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

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

Example Values: on, off, or no_change

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
Required
Type: DECIMAL
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

unique_key_hash_type
Required
Type: ENUMERATION
Length (Max/Min): N/A


Example Values: 
none, sha1, md5, sha1_with_base64, or md5_with_base64
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.

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

Sets redirect domain at campaign level.


Example Values: caketrk4.cake.com

 **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
https://demo-new.cakemarketing.com/api/3/addedit.asmx/Campaign?api_key=3YmDJeT3VHTFhDqAjr2OlQ&campaign_id=0&affiliate_id=1111665&offer_id=55378718&offer_contract_id=4789&media_type_id=15&third_party_name=&account_status_id=1&display_link_type_id=1&expiration_date=1/1/2000&expiration_date_modification_type=do_not_change&currency_id=1&use_offer_contract_payout=no_change&payout=2.25&payout_update_option=do_not_change&paid=on&static_suppression=11&paid_redirects=on&paid_upsells=on&review=off&auto_disposition_delay_hours=24&redirect_offer_contract_id=0&redirect_404=off&clear_session_on_conversion=off&postback_url=http://getCAKE.com/postback&postback_delay_ms=60000&unique_key_hash_type=none&test_link=http://google.com&redirect_domain=&pixel_html=%3Ciframe%20src%3D%22http%3A%2F%2Fandytrk.getCAKE.com%2Fp.hx%3Fo%3D455%26t%3DTRANSACTION_ID%22%20height%3D%221%22%20width%3D%221%22%20frameborder%3D%220%22%3E%3C%2Fiframe%3E 

 

Sample XML Responses:


Create:

 

<campaign_addedit_response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://cakemarketing.com/api/3/">
<success>true</success>
<message>Campaign Created</message>
<success_info>
<campaign_id>31075</campaign_id>
<affiliate_id>1111665</affiliate_id>
<offer_id>55378718</offer_id>
<offer_contract_id>4789</offer_contract_id>
<media_type_id>15</media_type_id>
<original>false</original>
</success_info>
</campaign_addedit_response>

 

Edit:

 

<campaign_addedit_response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://cakemarketing.com/api/3/">
<success>true</success>
<message>Campaign Updated</message>
<success_info>
<campaign_id>758864</campaign_id>
<affiliate_id>1111668</affiliate_id>
<offer_id>55379612</offer_id>
<offer_contract_id>6303</offer_contract_id>
<media_type_id>7</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