Get affiliate commission
curl --request GET \
--url https://api.4casters.io/affiliate/getAffiliateCommission \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/affiliate/getAffiliateCommission"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/affiliate/getAffiliateCommission', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.4casters.io/affiliate/getAffiliateCommission",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.4casters.io/affiliate/getAffiliateCommission"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.4casters.io/affiliate/getAffiliateCommission")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/affiliate/getAffiliateCommission")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"commissionPaid": [
{
"alice": 124.5
},
{
"bob": 12
}
]
}Affiliate
Get affiliate commission
Commission paid to you by your invited players
GET
/
affiliate
/
getAffiliateCommission
Get affiliate commission
curl --request GET \
--url https://api.4casters.io/affiliate/getAffiliateCommission \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/affiliate/getAffiliateCommission"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/affiliate/getAffiliateCommission', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.4casters.io/affiliate/getAffiliateCommission",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.4casters.io/affiliate/getAffiliateCommission"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.4casters.io/affiliate/getAffiliateCommission")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/affiliate/getAffiliateCommission")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"commissionPaid": [
{
"alice": 124.5
},
{
"bob": 12
}
]
}Returns commission paid to the caller by the players they have invited, grouped by player username. With no parameters, returns lifetime earnings; with
fromDate / toDate, restricts the range.
Unlike most endpoints, this one returns the result at the top level as
commissionPaid (not under data).Request
GET /affiliate/getAffiliateCommission
string
Start date (
MM-DD-YYYY). Defaults to 08-02-2021.string
End date (
MM-DD-YYYY). Defaults to today.curl "https://api.4casters.io/affiliate/getAffiliateCommission?fromDate=10-03-2022&toDate=10-10-2022" \
-H "Authorization: Bearer YOUR_TOKEN"
curl https://api.4casters.io/affiliate/getAffiliateCommission \
-H "Authorization: Bearer YOUR_TOKEN"
Response
array
Each entry is a single-key object mapping a player’s username to the total commission paid by that player in the requested range.
Example
{
"commissionPaid": [
{ "alice": 124.50 },
{ "bob": 12.00 },
{ "charlie": 87.34 }
]
}
Errors
| Status | Meaning |
|---|---|
400 | fromDate is not parseable. |
Authorizations
Pass your auth token in the Authorization header. The Bearer prefix is optional; the server also accepts a signed auth cookie or a token field in the request body.
Query Parameters
Start date (MM-DD-YYYY). Defaults to 08-02-2021.
Example:
"10-03-2022"
End date (MM-DD-YYYY). Defaults to today.
Example:
"10-10-2022"
Response
Commission summary
Each entry is a single-key object mapping a player's username to total commission paid.
Show child attributes
Show child attributes
Example:
[{ "alice": 124.5 }, { "bob": 12 }]
Was this page helpful?