Get reports for promoters
curl --request GET \
--url https://api.firstpromoter.com/api/v2/company/reports/promoters \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firstpromoter.com/api/v2/company/reports/promoters"
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Account-ID': '<account-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.firstpromoter.com/api/v2/company/reports/promoters', 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.firstpromoter.com/api/v2/company/reports/promoters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Account-ID: <account-id>",
"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.firstpromoter.com/api/v2/company/reports/promoters"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Account-ID", "<account-id>")
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.firstpromoter.com/api/v2/company/reports/promoters")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/reports/promoters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"promoter": {
"id": 123,
"email": "jsmith@example.com",
"name": "<string>"
},
"id": 123,
"data": {
"revenue_amount": 123,
"net_revenue_amount": 123,
"promoter_earnings_amount": 123,
"customers_count": 123,
"referrals_count": 123,
"clicks_count": 123,
"active_customers": 123,
"3m_epc": 123
},
"sub_data": [
{
"period": "<string>",
"id": "<string>",
"data": {
"revenue_amount": 123,
"net_revenue_amount": 123,
"promoter_earnings_amount": 123,
"customers_count": 123,
"referrals_count": 123,
"clicks_count": 123,
"active_customers": 123,
"3m_epc": 123
}
}
]
}
]{
"message": "Unauthorized",
"code": "<string>"
}{
"message": "Invalid user type",
"code": "forbidden"
}{
"message": "param is missing or the value is empty: columns",
"code": "invalid_params"
}Reports
Get reports for promoters
With this endpoint you can get the report data grouped by promoters.
HTTP Request
GET https://api.firstpromoter.com/api/v2/company/reports/promotersGET
/
reports
/
promoters
Get reports for promoters
curl --request GET \
--url https://api.firstpromoter.com/api/v2/company/reports/promoters \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firstpromoter.com/api/v2/company/reports/promoters"
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Account-ID': '<account-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.firstpromoter.com/api/v2/company/reports/promoters', 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.firstpromoter.com/api/v2/company/reports/promoters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Account-ID: <account-id>",
"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.firstpromoter.com/api/v2/company/reports/promoters"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Account-ID", "<account-id>")
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.firstpromoter.com/api/v2/company/reports/promoters")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/reports/promoters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"promoter": {
"id": 123,
"email": "jsmith@example.com",
"name": "<string>"
},
"id": 123,
"data": {
"revenue_amount": 123,
"net_revenue_amount": 123,
"promoter_earnings_amount": 123,
"customers_count": 123,
"referrals_count": 123,
"clicks_count": 123,
"active_customers": 123,
"3m_epc": 123
},
"sub_data": [
{
"period": "<string>",
"id": "<string>",
"data": {
"revenue_amount": 123,
"net_revenue_amount": 123,
"promoter_earnings_amount": 123,
"customers_count": 123,
"referrals_count": 123,
"clicks_count": 123,
"active_customers": 123,
"3m_epc": 123
}
}
]
}
]{
"message": "Unauthorized",
"code": "<string>"
}{
"message": "Invalid user type",
"code": "forbidden"
}{
"message": "param is missing or the value is empty: columns",
"code": "invalid_params"
}Authorizations
API key passed as a Bearer token in the Authorization header. You can find your API Key on Your FirstPromoter Dashboard. Navigate to Settings → Integrations → Manage API Keys
Headers
Account id. You can find your Account ID on Your FirstPromoter Dashboard. Navigate to Settings → Integrations
Example:
"acc_123456"
Query Parameters
Fields to be included in the report
Available options:
active_customers, monthly_churn, clicks_count, net_revenue_amount, revenue_amount, referrals_count, customers_count, sales_count, refunds_count, cancelled_customers_count, promoter_earnings_amount, non_link_customers, referrals_to_customers_cr, 3m_epc, 6m_epc, clicks_to_customers_cr, clicks_to_referrals_cr, promoter_paid_amount, signups_count Search query string
Time period grouping
Available options:
day, week, month, year Start date for the report period
End date for the report period
Sorting parameters
Show child attributes
Show child attributes