Sample Code – Get Single Payment

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://account.idevaffiliate.com/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);
var client = new RestClient("https://account.idevaffiliate.com/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);
package main

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

func main() {

	url := "https://account.idevaffiliate.com/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))

}
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://account.idevaffiliate.com/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();
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();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://account.idevaffiliate.com/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;
}
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"))
require 'uri'
require 'net/http'

url = URI("https://account.idevaffiliate.com/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
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://account.idevaffiliate.com/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()