ADDEDIT Caps API Version 1

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

 

Summary:

Allows you to create or update Cap details for an offer/campaign in CAKE.

 

Resource/WSDL Page:

http://yourdomainhere/api/1/addedit.asmx?op=Caps

 

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

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.

0 to skip

Example Values: 1234

 

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

This is the identifier for a unique Offer Contract ID.

0 to skip

Example Values: 1234

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

This is the identifier for a unique campaign. You can obtain the campaign ID from your CAKE instance on the campaign card. To get there, go to the advertiser tab >> offers >> choose an offer to open the offer card >> campaign tab >> choose a campaign >> ID. 

0 to skip

Example Values: 1234

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

Click cap = 1
Conversion cap = 2

 

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

Set to null=-1

Lifetime = 0
Daily = 1
Weekly = 2
Monthly = 3
Custom = 4

 

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

Specific amount for the cap.

-1 to set to NULL

Example Values: 1234

cap_start
Optional
Type: DATETIME
Length (Max/Min): N/A

Start date for the cap.

only used if cap_interval_id is custom (4)

 

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

Should an alert be sent or not?

Example Values: TRUE

 **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/Caps?
api_key=dNJFmId9rI&offer_id=100&offer_contract_id=0&campaign_id=0
&cap_type_id=1&cap_interval_id=2&cap_amount=100&cap_start=8/8/1979
&send_alert_only=FALSE

 

Sample XML Response:

<caps_addedit_response>
   <success>true</success>
   <message>Cap Updated</message>
</caps_addedit_response>

 

Example Error Messages: 

Error Message

Likely Cause

Invalid API Key

API key does not exist or is expired.

Invalid Campaign

no campaign found for the specified campaign_id

Invalid Offer Contract

no offer contract found for the specified offer_contract_id

Invalid Offer

no offer found for the specified offer_id

Invalid Cap Type

no cap type found for the specified cap_type_id

Invalid Cap Interval

no cap interval found for the specified cap_interval_id or you passed a 0 cap_interval_id and a cap_amount that doesn't equal -1

Update Error - Campaign ID: ###

general error when the campaign save fails

Update Error - Offer Contract ID: ###

general error when the offer contract save fails

Update Error - Offer ID: ###

general error when the offer save fails