ADDEDIT GeoTargets API Version 2
Updated on 2015-01-13
Current Version: Version 2
Deprecated Version: 1
Requests Allowed: GET&SOAP
Summary:
Returns "Countries Added", "Countries Replaced", or "Countries Removed"
Resource/WSDL Page:
http://<your_domain_here>/api/2/addedit.asmx?op=GeoTargets
Parameters
api_key |
Must be a valid API key (existing and NOT expired) Example Values: Fo35NRAqvFLXoZxqB4aVMhh |
offer_contract_id |
Obtained via EXPORT Offers API Example Values: 1234 |
set_targeting_to_geo |
Apply geo targeting to offer contract? Example Values: True, False |
add_edit_option |
Denotes whether you are adding, removing, or replacing current geo targeting configuration Example Values: add, remove, replace |
countries |
Comma separated list of country codes to add, remove, or replace. Example Value: US,MX |
allow_countries |
Is traffic from the above countries allowed on the offer? Example Values: True, False |
redirect_offer_contract_ids |
If allow_countries=false, pass the corresponding offer contract IDs where you would like the country specific traffic redirected to. If allow_countries=true, pass the offer contract ID you are applying geo targeting to (offer_contract_id above). You will need to pass an offer contract ID for each country included in the countries field Example Values: 12789,44896 |
**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 GET Request
http://demo.cakemarketing.com/api/2/addedit.asmx/GeoTargets?api_key=YM6FNThM7EnEDC7AAGpp3K2oRjJdGFP&offer_contract_id=8078&set_targeting_to_geo=true&add_edit_option=replace&countries=US,MX,GB,CA,NZ,SE&allow_countries=true&redirect_offer_contract_ids=8078,8078,8078,8078,8078,8078 |
Sample XML Response:
<geo_targets_addedit_response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://cakemarketing.com/api/2/"> <success>true</success> <message>Geotarget(s) Replaced</message> <row_count>6</row_count> </geo_targets_addedit_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_id does not correspond to an offer contract in the system |
Please Provide Valid Country Code(s) |
one or more of the country codes provided is not valid |