Offerit REST API Delete Creative Rules
From Offerit
Revision as of 15:50, 22 March 2017 by OfferitRob (talk | contribs)
POST /creative/delete_creative_rule
Description
- delete_creative_rule deletes creative rules
Resource URL
- http://domain/api/creative/add_creative_rule
- Replace domain with the Offerit domain
Response Format
- JSON
- POST
- HTTP headers
Parameters
- creativeids
- type: integer,string,array
- required
- creativeids for which you are deleting rules. accepts int, comma separated list of ints, array of ints.
- ruleids
- type: string,array
- required
- ruleids to delete. accepts string, comma separated list of strings, array of strings.
Example Request
POST
http://domain/api/creative/delete_creative_rule?creativeids=1&ruleids=57c738de72d59
- Response:
{ "successes": [ { "creativeid": "13", "ruleid": "57c738de72d59" } ], "failures": [], "total_successes": 1 }
Example Code
PHP
<?php $url = 'http://domain/api/creative/delete_creative_rule' $curl = curl_init(); $headers = array( 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: productsupport' ); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_URL, $url); $data = Array( 'creativeids' => 1, 'ruleids' => '57c738de72d59' ); $resp = curl_exec($curl); //dumps an associative array representation of the json var_dump(json_decode($resp, true)); // Close request to clear up some resources curl_close($curl); ?>