ADDEDIT OfferContract API

Updated on 2014-05-01
Current Version: Version 1
Deprecated Version: NA
Requests Allowed: GET&SOAP
 

Summary:

Allows you to create or update OfferContract in CAKE.

Resource/WSDL Page:


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


Parameters

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

Must be a valid API Key (existing and NOT expired)

Example Values: Fo35NRAqvFLXoZxqB4aViaiYM7iVMhh

offer_id
Required
Type: INT
Length (Max/Min): NA

Required

Example Values:  

offer_contract_id
Required
Type: INT
Length (Max/Min): NA

Required

Example Values: 0 to create, > 0 to edit

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

Required

Example Values:

price_format_id
Required
Type: INT
length (Max/Min): NA

Required

Example Values:

payout
Required
Type: DECIMAL
length (Max/Min): NA

Required

Example Values:

received
Required
Type: DECIMAL
length (Max/Min): NA

Required

Example Values:

received_percentage
Required
Type: BOOL
length (Max/Min): NA

Required

Example Values: True, False

offer_link
Required
Type: STRING
length (Max/Min): 400

Required

Example Values:

thankyou_link
Required
Type: STRING
length (Max/Min): 400

Required

Example Values:

offer_contract_hidden
Required
Type: BOOL
length (Max/Min): NA

Required

Example Values: True, False

offer_contract_is_default
Required
Type: BOOL
length (Max/Min): NA

Required

Example Values: True, False

use_fallback_targeting
Required
Type: BOOL
length (Max/Min): NA

Required

Example Values: True, False

 **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/OfferContract?api_key=dNJFmId9rI&offer_id=1000147&offer_contract_id=0&offer_contract_name=Myname&price_format_id=1&payout=10&received=100&received_percentage=FALSE&offer_link=http%3A%2F%2Fbradsexample.com&thankyou_link=http%3A%2F%2Fbradsexample.com%2FTY&offer_contract_hidden=FALSE&offer_contract_is_default=TRUE&use_fallback_targeting=FALSE

 

Sample XML Response:

<offercontract_addedit_response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://cakemarketing.com/api/1/">
   <success>true</success>
   <message>Offer Contract 3630 Created</message>
   <offer_contract_id>3630</offer_contract_id>
</offercontract_addedit_response>

 

Example Error Messages:  

Error Message

Likely Cause

Invalid API Key

API Key does not exist or is expired

Invalid Offer ID

offer_id does not correspond to an offer in the system

Invalid Offer Name

offer_contract_name is NULL or empty

Invalid Payout Amount

payout is less than 0

Invalid Received Amount

received is less than 0 or received is greater than 0 and the offer has an offer type of Hosted

Invalid Offer Link

offer_link is NULL or empty

Invalid Thankyou Link

thankyou_link is NULL or empty

Invalid Offer Contract ID

offer_contract_id does not correspond to an offer_contract in the system