Difference between revisions of "NATS For Networks REST API Delete Creative Rules"
From TMM Wiki
Jump to navigationJump to search (Created page with "{{NATS for Networks Manual | show_api_admin_section = true }} == '''POST /creative/delete_creative_rule''' == '''Description''' *delete_creative_rule deletes creative rules...") |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{NATS for Networks Manual | {{NATS for Networks Manual | ||
− | | | + | | show_rest_api_section = true |
}} | }} | ||
== '''POST /creative/delete_creative_rule''' == | == '''POST /creative/delete_creative_rule''' == | ||
Line 75: | Line 75: | ||
); | ); | ||
$resp = curl_exec($curl); | $resp = curl_exec($curl); | ||
− | //dumps an associative array representation of the json | + | //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 | // Close request to clear up some resources | ||
curl_close($curl); | curl_close($curl); |
Latest revision as of 16:46, 12 May 2017
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); ?>