NATS For Networks REST API Delete Creative Rules

From TMMwiki
Jump to: navigation, search
NATS For Networks
REST API
API Overview
GET /affiliate/search
POST /affiliate/affiliate_login_ips
GET /creative/get_creative_fields
GET /creative/get_creative_rules
PATCH /creative/undelete_creative
PATCH /creative/edit_creative_rules
PATCH /creative/edit_creative
PATCH /creative/delete_creative
POST /creative/delete_creative_rules
POST /creative/add_creative_rule
POST /creative/add_creative
GET /offer/check_orderid_exists
GET /report/profitloss
GET /report/transaction
GET /transaction/transaction_payout_preview
GET /service/ping




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

Request Method

  • POST

Authentication

  • 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); 
?>