Submit a Ticket My Tickets
Welcome
Login  Sign up

ADDEDIT ApplySharedRulesToOfferContract API Version 1

ADDEDIT ApplySharedRulesToOfferContract API

Updated on 2017-06-28
Current Version: Version 1
Deprecated Version: NA
Requests Allowed: GET&SOAP
 

Summary:

This API will assign rules to offer contracts via API. This version will support adding shared rules to offer contracts only. If a rule has not been shared the following service will error.

Resource/WSDL Page:

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

Parameters

api_key
Required
Type: STRING
Length (Max/Min): 50
Must be a valid API Key (existing and NOT expired)
Example Values: Fo35NRAqvFLXoZxqB4aViaiYM7iVMhh
offer_contract_id
Required
Type: INT
Length (Max/Min): NA
This is the identifier for a unique Offer Contract ID.
0 to skip
Example Values: 1234  
set_targeting_to_rules
Required
Type: BOOL
Length (Max/Min): 50
Example Values: True, False
add_edit_option
Required
Type: ENUM
Length (Max/Min): NA
Add, Remove or Replace
Example Values: replace
rule_ids
Required
Type: STRING
length (Max/Min): 30
Can pass comma separated IDs
Example Values: 3981
rule_statuses
Required
Type: STRING
Length (Max/Min): NA
Active or deactivate rules
Can pass a comma separated list of on, off, or no_change
Can pass "0" when add_edit_option is "remove". Must pass a "0" for each corresponding rule_id
Example Values: on
redirect_offer_contract_ids
Required
Type: STRING
Length (Max/Min): NA
Can pass a comma separated list of IDs, maps to rule_id list. Must pass the same number of elements.
Can pass "0" when add_edit_option is "remove" or "replace". Must pass a "0" for each corresponding rule_id
Example Values: 22297

**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/1/addedit.asmx/ApplySharedRulesToOfferContract?api_key=7kkLImWsRr2kPLjBwrPEd2g07ks8daj&offer_contract_id=21635&set_targeting_to_rules=True&add_edit_option=replace&rule_ids=4087&rule_statuses=on&redirect_offer_contract_ids=22297

 

<rules_targets_addedit_response_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>Rules Replaced</message>
<row_count>0</row_count>
</rules_targets_addedit_response_response>



Example Error Messages:  

Error Message
Likely Cause
Invalid API Key
API Key does not exist or is expired
Invalid offer_contract_id
Offer contract does not exist in database
Invalid rule_idEither does not exist in database or not a shared rule
Invalid rule_id, rule_status, redirect_offer_contract_idDoes not exist in the database or combination   



















Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.