curl --request GET \
--url https://firstpromoter.com/api/v1/leads/list \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/leads/list"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/leads/list', 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://firstpromoter.com/api/v1/leads/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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://firstpromoter.com/api/v1/leads/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://firstpromoter.com/api/v1/leads/list")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/leads/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 123,
"state": "signup",
"uid": "<unknown>",
"email": "jsmith@example.com",
"customer_since": "<string>",
"cancelled_at": "<string>",
"plan_name": "<string>",
"suspicion": "<string>",
"username": "<string>",
"website": "<string>",
"created_at": "<string>",
"split_promotion_id": "<unknown>",
"custom_fields": "<unknown>",
"split_percentage_value": "<unknown>",
"visitor_sub_id": "<unknown>",
"promotion": {
"id": 123,
"status": "<string>",
"ref_id": "<string>",
"promo_code": "<string>",
"customer_promo_code": "<string>",
"target_reached_at": "<string>",
"promoter_id": 123,
"campaign_id": 123,
"referral_link": "<string>",
"current_offer": {
"id": 123,
"name": "<string>",
"amount": 123,
"unit": "<string>",
"default_promo_code": "<string>"
},
"current_referral_reward": {
"id": 123,
"amount": 123,
"unit": "<string>",
"name": "<string>",
"per_of_sale": 123,
"default_promo_code": "<string>"
},
"current_promotion_reward": {},
"current_target_reward": {},
"campaign_name": "<string>",
"hidden": true,
"visitors_count": 123,
"leads_count": 123,
"customers_count": 123,
"refunds_count": 123,
"cancellations_count": 123,
"sales_count": 123,
"sales_total": 123,
"refunds_total": 123,
"active_customers_count": 123
},
"promoter": {
"id": 123,
"status": "approved",
"cust_id": "<unknown>",
"email": "<string>",
"created_at": "<string>",
"temp_password": "<string>",
"default_promotion_id": 123,
"pref": "<string>",
"default_ref_id": "<string>",
"note": "<string>",
"w8_form_url": "<unknown>",
"w9_form_url": "<unknown>",
"parent_promoter_id": "<string>",
"earnings_balance": {},
"current_balance": {},
"paid_balance": {},
"auth_token": "<string>"
}
}
]"Bad credentials"{
"error": "Promotion not found."
}List leads/customers
With this endpoint you can list all the leads and customers assigned to a promotion, promoter, campaign or entire account using the API.
--include option on curl request to see the pagination details format and links to next pages.GET https://firstpromoter.com/api/v1/leads/listcurl --request GET \
--url https://firstpromoter.com/api/v1/leads/list \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/leads/list"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/leads/list', 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://firstpromoter.com/api/v1/leads/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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://firstpromoter.com/api/v1/leads/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://firstpromoter.com/api/v1/leads/list")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/leads/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 123,
"state": "signup",
"uid": "<unknown>",
"email": "jsmith@example.com",
"customer_since": "<string>",
"cancelled_at": "<string>",
"plan_name": "<string>",
"suspicion": "<string>",
"username": "<string>",
"website": "<string>",
"created_at": "<string>",
"split_promotion_id": "<unknown>",
"custom_fields": "<unknown>",
"split_percentage_value": "<unknown>",
"visitor_sub_id": "<unknown>",
"promotion": {
"id": 123,
"status": "<string>",
"ref_id": "<string>",
"promo_code": "<string>",
"customer_promo_code": "<string>",
"target_reached_at": "<string>",
"promoter_id": 123,
"campaign_id": 123,
"referral_link": "<string>",
"current_offer": {
"id": 123,
"name": "<string>",
"amount": 123,
"unit": "<string>",
"default_promo_code": "<string>"
},
"current_referral_reward": {
"id": 123,
"amount": 123,
"unit": "<string>",
"name": "<string>",
"per_of_sale": 123,
"default_promo_code": "<string>"
},
"current_promotion_reward": {},
"current_target_reward": {},
"campaign_name": "<string>",
"hidden": true,
"visitors_count": 123,
"leads_count": 123,
"customers_count": 123,
"refunds_count": 123,
"cancellations_count": 123,
"sales_count": 123,
"sales_total": 123,
"refunds_total": 123,
"active_customers_count": 123
},
"promoter": {
"id": 123,
"status": "approved",
"cust_id": "<unknown>",
"email": "<string>",
"created_at": "<string>",
"temp_password": "<string>",
"default_promotion_id": 123,
"pref": "<string>",
"default_ref_id": "<string>",
"note": "<string>",
"w8_form_url": "<unknown>",
"w9_form_url": "<unknown>",
"parent_promoter_id": "<string>",
"earnings_balance": {},
"current_balance": {},
"paid_balance": {},
"auth_token": "<string>"
}
}
]"Bad credentials"{
"error": "Promotion not found."
}Authorizations
Query Parameters
List all leads and customers assigned to this promotion id
List all leads and customers assigned to a promotion - find promotion by ref_id
List all leads and customers assigned to a promoter
List all leads and customers in a campaign
Response
Get the list of leads and customers response
The lead's ID inside FirstPromoter
The lead's or customer's status
signup, active, subscribed, denied, cancelled Your lead/customer's user ID inside your application.
The lead's or customer's email
ISO date string at which the lead converted to a customer.
ISO date string at which the lead/customer cancelled
ISO date string at which the lead/customer signed up
Show child attributes
Show child attributes
Show child attributes
Show child attributes