NATS For Networks REST API Delete Creative Rules
From TMM Wiki
Jump to navigationJump to searchThe printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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 NATS for Networks 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 response $output = json_decode($resp, true); if($output !== NULL) { //json was valid. Dump the decoded array print_r($output); } else { //invalid json, just dump the raw response print_r($resp); } // Close request to clear up some resources curl_close($curl); ?>