What is a REST API?

A REST API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data.
A REST API -- also referred to as a REST web service -- is based on representational state transfer (REST) technology, an architectural style and approach to communications often used in web services development.


Enable your REST API

Login to your iDevAffiliate admin center and go to Tools > API > REST API. Enable REST API.


What is Secret Key?

Secret key cryptography relies on using the same key to encode and then later decode a message. Thus, only those who know the "secret" can read the message.
RSA security is based on 2 matching keys. There is a public key for each user, and everybody can (should) know it. There is also a private key that only the user should know. A message encrypted by the public key can only be decrypted by the private key, and visa versa.
Thus, if I want to send you a message that only you can read, I get (from the network) your public key, encrypt the message with that key and you are the only person who can decrypt it.


Get Secret Key

Login to your iDevAffiliate admin center and go to Tools > API > REST API. Copy Secret Key.


Affiliate Authentication

This request is for affiliate authentication REST API.
URL: http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php
Request type: POST

Request body:
Key Value Required Description
userid Affiliate username True Username of the affiliate account.
password Affiliate password True Password of the affiliate account.
Response:
Key Value Type Description
message String Text message for success or error.
affiliate_id Integer Affiliate ID of the authenticated/requested affiliate user.
token String Encrypted token for authorization in other requests.
bool True / False Boolean Indicates is request is success or not.

Authenticate / Login REST API

This request is for login REST API.
URL: http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php
Request type: POST

Request body:
Key Value Required Description
api_secret Secret Key True This secret key is for authenticate user.
Response:
Key Value Type Description
message String Text message for success or error.
token String Encrypted token for authorization in other requests.
bool True / False Boolean Indicates is request is success or not.

Get Traffic Data

This Request is for get traffic log data.
URL: http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php
Request type: GET

Request Header:
Key Value Required Description
Response:
Key Value Type Description
message String Text message for success or error.
bool True / False Boolean Indicates is request is success or not.

Get Commissions Data

There are four type of commission data. Please see below for commission types


Pending

This request is for get pending commission data.
URL: http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php
Request type: GET

Request param:
Key Value Required Description
commission_type pending_approval True This param get only pending commissions
Request header:
Key Value Required Description
Response:
Key Value Type Description
message String Text message for success or error.
bool True / False Boolean Indicates is request is success or not.

Currently

This request is for get currently commission data.
URL: http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php
Request type: GET

Request param:
Key Value Required Description
commission_type currently_approved True This param get only current commissions
Request header:
Key Value Required Description
Response:
Key Value Type Description
message String Text message for success or error.
bool True / False Boolean Indicates is request is success or not.

Delayed

This request is for get delayed commission data.
URL: http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php
Request type: GET

Request param:
Key Value Required Description
commission_type delayed True This param get only delayed commissions
Request header:
Key Value Required Description
Response:
Key Value Type Description
message String Text message for success or error.
bool True / False Boolean Indicates is request is success or not.

Declined

This Request is for get declined commission data.
URL: http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php
Request type: GET

Request param:
Key Value Required Description
commission_type declined True This param get only declined commissions
Request header:
Key Value Required Description
Response:
Key Value Type Description
message String Text message for success or error.
bool True / False Boolean Indicates is request is success or not.

Get payments data

There are two type of get payment services. Please see below.


All Affiliates

This Request is for get all affiliates payments data.
URL: http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php
Request type: GET

Request header:
Key Value Required Description
Response:
Key Value Type Description
message String Text message for success or error.
bool True / False Boolean Indicates is request is success or not.

Single Affiliate

This Request is for get single affiliate payments data.
URL: http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php
Request type: GET

Request params:
Key Value Required Description
aff_id True The value of this parameter is affiliate id which you want to see payment data.
Request header:
Key Value Required Description
Response:
Key Value Type Description
message String Text message for success or error.
bool True / False Boolean Indicates is request is success or not.

Get Affiliate Data

There are Three type of Get Affiliate Services. Please see below.


Approved Affiliates

This Request is for get Approved Affiliates Data.
URL: http://idevtest.com/ninetwo/API/rest-api/getAffiliate.php
Request Type: GET

Request Params:
Key Default Type Required Description
affiliate_type approved String True The value of this parameter is affiliate type which you want to see affiliate data.
Request Header:
Key Value Required Description
Response:
Key Type Description
message String Text Message for success or error.
id Integer Unique ID of the affiliate.
username String Username of the affiliate.
f_name String First Name of the affiliate.
l_name String Last Name of the affiliate.
signup_date Date Affiliate account created date
bool Boolean Indicates is request is success or not.

Pending Affiliates

This Request is for get Pending Affiliates Data.
URL: http://idevtest.com/ninetwo/API/rest-api/getAffiliate.php
Request Type: GET

Request Params:
Key Default Type Required Description
affiliate_type pending String True The value of this parameter is affiliate type which you want to see affiliate data.
Request Header:
Key Value Required Description
Response:
Key Type Description
message String Text Message for success or error.
id Integer Unique ID of the affiliate.
username String Username of the affiliate.
signup_date Date Affiliate account created date
bool Boolean Indicates is request is success or not.

Declined Affiliates

This Request is for get Pending Affiliates Data.
URL: http://idevtest.com/ninetwo/API/rest-api/getAffiliate.php
Request Type: GET

Request Params:
Key Default Type Required Description
affiliate_type declined String True The value of this parameter is affiliate type which you want to see affiliate data.
Request Header:
Key Value Required Description
Response:
Key Type Description
message String Text Message for success or error.
id Integer Unique ID of the affiliate.
username String Username of the affiliate.
email String Email of the affiliate.
bool Boolean Indicates is request is success or not.

Response objects and arrays

There are only two objects are default in each request.

Name Type Description
message String This is a simple text object which returns string success or error message(Text).
bool Boolean This is a simple boolean object which returns true or false. If false then there is an error in request and the error message shown in message object.

data

This is not an object. This is a json array. And in this array there are multiple objects.


Get traffic data:
Name Type Description
id Integer Affiliate ID
username String Affiliate username
location Object Traffic location information
date String Date of visit
time String Time of visit
isValid String Check validity
Get commissions data:

These are the common object in all four get commission data data array objects.

Name Type Description
id Integer Affiliate ID
username String Affiliate username
date String Commission date
time String Commission time
commission_amount String Amount of the commission
order_number String Order number unique
Pending:
Name Type Description
flag_icon String URL of country flag image
Currently:
Name Type Description
commission_type String Type of commission
Delayed:
Name Type Description
flag_icon String URL of country flag image
Declined:
Name Type Description
flag_icon String URL of country flag image

Payments

This is an object where affiliate payment information stored.

Name Type Description
total Float Sum of all payments amount.
complete_data Array This is an array of objects
complete_data:
Name Type Description
record Integer Unique record ID
id Integer Affiliate ID
amount Float Payment amount
stamp Float Payment date and time

Sample request codes

Affiliate Authentication

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "userid=username&password=test");

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "userid=username", ParameterType.RequestBody);
request.AddParameter("application/x-www-form-urlencoded", "password=test", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php"

	payload := strings.NewReader("userid=username&password=test")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/x-www-form-urlencoded")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "userid=username&password=test");
Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php")
  .post(body)
  .addHeader("content-type", "application/x-www-form-urlencoded")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var qs = require("querystring");
var http = require("http");

var options = {
  "method": "POST",
  "hostname": "yoursite.com",
  "port": null,
  "path": "/idevaffiliate/API/rest-api/affiliateAuthenticate.php",
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(qs.stringify({ userid: 'username', password: 'test' }));
req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "userid=username&password=test",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("yoursite.com")

payload = "userid=username&password=test"

headers = {
    'content-type': "application/x-www-form-urlencoded",
    'cache-control': "no-cache"
    }

conn.request("POST", "/idevaffiliate/API/rest-api/affiliateAuthenticate.php", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request["cache-control"] = 'no-cache'
request.body = "userid=username&password"

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "content-type": "application/x-www-form-urlencoded",
  "cache-control": "no-cache"
]

let postData = NSMutableData(data: "userid=username&password=test".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/affiliateAuthenticate.php")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Authenticate / Login

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "api_secret=Secret Key");

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "api_secret=Secret Key", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php"

	payload := strings.NewReader("api_secret=Secret Key")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/x-www-form-urlencoded")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "api_secret=Secret Key");
Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php")
  .post(body)
  .addHeader("content-type", "application/x-www-form-urlencoded")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var qs = require("querystring");
var http = require("http");

var options = {
  "method": "POST",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/authenticate.php",
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(qs.stringify({ api_secret: 'Secret Key' }));
req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "api_secret=Secret Key",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

payload = "api_secret=Secret Key"

headers = {
    'content-type': "application/x-www-form-urlencoded",
    'cache-control': "no-cache"
    }

conn.request("POST", "/ninetwo/API/rest-api/authenticate.php", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request["cache-control"] = 'no-cache'
request.body = "api_secret=Secret Key"

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "content-type": "application/x-www-form-urlencoded",
  "cache-control": "no-cache"
]

let postData = NSMutableData(data: "api_secret=Secret Key".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/authenticate.php")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Get Traffic Data

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php")
  .get()
  .addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/getTraffic.php",
  "headers": {
    "authorization": "Bearer (Token in response of authenticate / login request)",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer (Token in response of authenticate / login request)",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

headers = {
    'authorization': "Bearer (Token in response of authenticate / login request)",
    'cache-control': "no-cache"
    }

conn.request("GET", "/ninetwo/API/rest-api/getTraffic.php", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "authorization": "Bearer (Token in response of authenticate / login request)",
  "cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/getTraffic.php")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Get Commissions Data Pending

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=pending_approval");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=pending_approval");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=pending_approval"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=pending_approval")
  .get()
  .addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/getCommissions.php?commission_type=pending_approval",
  "headers": {
    "authorization": "Bearer (Token in response of authenticate / login request)",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=pending_approval",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer (Token in response of authenticate / login request)",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

headers = {
    'authorization': "Bearer (Token in response of authenticate / login request)",
    'cache-control': "no-cache"
    }

conn.request("GET", "/ninetwo/API/rest-api/getCommissions.php?commission_type=pending_approval", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=pending_approval")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "authorization": "Bearer (Token in response of authenticate / login request)",
  "cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=pending_approval")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Get Commissions Data Currently

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=currently_approved");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=currently_approved");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=currently_approved"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=currently_approved")
  .get()
  .addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/getCommissions.php?commission_type=currently_approved",
  "headers": {
    "authorization": "Bearer (Token in response of authenticate / login request)",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=currently_approved",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer (Token in response of authenticate / login request)",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

headers = {
    'authorization': "Bearer (Token in response of authenticate / login request)",
    'cache-control': "no-cache"
    }

conn.request("GET", "/ninetwo/API/rest-api/getCommissions.php?commission_type=currently_approved", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=currently_approved")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "authorization": "Bearer (Token in response of authenticate / login request)",
  "cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=currently_approved")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Get Commissions Data Delayed

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=delayed");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=delayed");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=delayed"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=delayed")
  .get()
  .addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/getCommissions.php?commission_type=delayed",
  "headers": {
    "authorization": "Bearer (Token in response of authenticate / login request)",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=delayed",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer (Token in response of authenticate / login request)",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

headers = {
    'authorization': "Bearer (Token in response of authenticate / login request)",
    'cache-control': "no-cache"
    }

conn.request("GET", "/ninetwo/API/rest-api/getCommissions.php?commission_type=delayed", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=delayed")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "authorization": "Bearer (Token in response of authenticate / login request)",
  "cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=delayed")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Get Commissions Data Declined

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=declined");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=declined");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=declined"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=declined")
  .get()
  .addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/getCommissions.php?commission_type=declined",
  "headers": {
    "authorization": "Bearer (Token in response of authenticate / login request)",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=declined",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer (Token in response of authenticate / login request)",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

headers = {
    'authorization': "Bearer (Token in response of authenticate / login request)",
    'cache-control': "no-cache"
    }

conn.request("GET", "/ninetwo/API/rest-api/getCommissions.php?commission_type=declined", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=declined")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "authorization": "Bearer (Token in response of authenticate / login request)",
  "cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/getCommissions.php?commission_type=declined")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Get Payments Data All

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php")
  .get()
  .addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/getPayments.php",
  "headers": {
    "authorization": "Bearer (Token in response of authenticate / login request)",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer (Token in response of authenticate / login request)",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

headers = {
    'authorization': "Bearer (Token in response of authenticate / login request)",
    'cache-control': "no-cache"
    }

conn.request("GET", "/ninetwo/API/rest-api/getPayments.php", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "authorization": "Bearer (Token in response of authenticate / login request)",
  "cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Get Payments Data Single

copy
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php?aff_id=(Affiliate ID)");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "authorization: Bearer (Token in response of authenticate / login request)");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
copy
var client = new RestClient("http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php?aff_id=(Affiliate ID)");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Bearer (Token in response of authenticate / login request)");
IRestResponse response = client.Execute(request);
copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php?aff_id=(Affiliate ID)"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "Bearer (Token in response of authenticate / login request)")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
copy
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php?aff_id=(Affiliate ID)")
  .get()
  .addHeader("authorization", "Bearer (Token in response of authenticate / login request)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
copy
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "idevtest.com",
  "port": null,
  "path": "/ninetwo/API/rest-api/getPayments.php?aff_id=(Affiliate ID)",
  "headers": {
    "authorization": "Bearer (Token in response of authenticate / login request)",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
copy
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php?aff_id=(Affiliate ID)",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer (Token in response of authenticate / login request)",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
copy
import http.client

conn = http.client.HTTPConnection("idevtest.com")

headers = {
    'authorization': "Bearer (Token in response of authenticate / login request)",
    'cache-control': "no-cache"
    }

conn.request("GET", "/ninetwo/API/rest-api/getPayments.php?aff_id=(Affiliate ID)", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
copy
require 'uri'
require 'net/http'

url = URI("http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php?aff_id=(Affiliate ID)")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer (Token in response of authenticate / login request)'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
copy
import Foundation

let headers = [
  "authorization": "Bearer (Token in response of authenticate / login request)",
  "cache-control": "no-cache"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://yoursite.com/idevaffiliate/API/rest-api/getPayments.php?aff_id=(Affiliate ID)")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()