NATS5 REST API Program GET additional-payout-change-targets
From TMM Wiki
Jump to navigationJump to searchGET /program/additional-payout-change-targets
Description
- Get additional payout change fields for selected program
Resource URL
- http://domain/api/program/additional-payout-change-targets
- Replace domain with the nats domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
Parameters can be sent as url encoded params
- programid
- type: digit
- required
Example Request
Method: GET
URL: http://domain/api/program/additional-payout-change-targets
Query String: programid=2
Response:
{ "success": true, "additional_targets": [ { "title": "Processing Type(s)", "type": "multiselect", "values": "biller_type_ids_reversed", "default": -1, "program_types": [ 0, 2, 3, 100, 101, 102 ], "target": "process_type", "values_list": [ { "id": 0, "name": "cc" }, { "id": 1, "name": "check" }, { "id": 2, "name": "dialer" }, { "id": 3, "name": "elv" }, { "id": 4, "name": "asian" }, { "id": 5, "name": "ob" }, { "id": 6, "name": "sms" }, { "id": 7, "name": 900 }, { "id": 8, "name": "inv" }, { "id": 9, "name": "trans" }, { "id": 10, "name": "combo" }, { "id": 11, "name": "pre" }, { "id": 12, "name": "phone" }, { "id": 13, "name": "gphone" }, { "id": 14, "name": "dp" }, { "id": 15, "name": "instant" }, { "id": 16, "name": "idl" }, { "id": 17, "name": "snp" }, { "id": 18, "name": "cnd" }, { "id": 19, "name": "knd" }, { "id": 20, "name": "eay" }, { "id": 21, "name": "pys" }, { "id": 22, "name": "bpy" }, { "id": 23, "name": "eao" }, { "id": 24, "name": "prz" }, { "id": 25, "name": "voucher" }, { "id": 26, "name": "idv" }, { "id": 27, "name": "pound" }, { "id": 28, "name": "dtm" }, { "id": 29, "name": "bcoin" }, { "id": 30, "name": "bd" }, { "id": 31, "name": "poa" }, { "id": 32, "name": "sof" }, { "id": 33, "name": "paypal" }, { "id": 34, "name": "psc" }, { "id": 35, "name": "cbuy" }, { "id": 36, "name": "gpay" }, { "id": 37, "name": "eps" }, { "id": 38, "name": "mpass" }, { "id": 39, "name": "pin" }, { "id": 40, "name": "atm" }, { "id": 41, "name": "cash" }, { "id": 42, "name": "ewallet" }, { "id": 43, "name": "va" }, { "id": 44, "name": "dc" }, { "id": 45, "name": "astro" }, { "id": 46, "name": "sepa" }, { "id": 47, "name": "tgreso" }, { "id": 48, "name": "telepay" }, { "id": 49, "name": "poliau" }, { "id": 50, "name": "polinz" }, { "id": 51, "name": "ypay" }, { "id": 52, "name": "apc" }, { "id": 53, "name": "gc" }, { "id": 54, "name": "wap" }, { "id": 55, "name": "mobile" }, { "id": 56, "name": "maestro" }, { "id": 57, "name": "bccard" }, { "id": 58, "name": "mistercash" }, { "id": 59, "name": "enets" }, { "id": 60, "name": "abaqoos" }, { "id": 61, "name": "poli" }, { "id": 62, "name": "neosurf" }, { "id": 63, "name": "epaybg" }, { "id": 64, "name": "safetpapy" }, { "id": 65, "name": "toditocash" }, { "id": 66, "name": "banklink" }, { "id": 67, "name": "ekonto" }, { "id": 68, "name": "sporopay" }, { "id": 69, "name": "unet" }, { "id": 70, "name": "ticketp" }, { "id": 71, "name": "postepay" }, { "id": 72, "name": "euteller" }, { "id": 73, "name": "qiwi" }, { "id": 74, "name": "boletoo" }, { "id": 75, "name": "ymoney" }, { "id": 76, "name": "switch" }, { "id": 77, "name": "bz" }, { "id": 78, "name": "io" }, { "id": 79, "name": "crypto" } ] } ] }
Example Code
PHP
<?php $headers = array( //set your username and API key here 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: tmm1phrvezsbu' ); $url = 'http://yourdomain.com'; //set your NATS URL here $data = Array( 'programid' => 2, ); $request = Array( 'method' => 'GET', 'path' => 'v1/program/additional-payout-change-targets', 'data' => $data ); /*code below is the same for (almost) every API call */ $curl = curl_init(); $url = $url.'/api/'.$request['path']; $query = http_build_query($request['data']); if($request['method'] == 'GET'){ //add query string parameters to the end of the url $url = $url.'?'.$query; }else{ //send parameters as POST fields curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $query); if($request['method'] != 'POST'){ $headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method } } curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $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); ?>