curl --request POST \
--url https://firstpromoter.com/api/v1/promoters/add_to_campaign \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/promoters/add_to_campaign"
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/promoters/add_to_campaign', 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/promoters/add_to_campaign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/promoters/add_to_campaign"
req, _ := http.NewRequest("POST", 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.post("https://firstpromoter.com/api/v1/promoters/add_to_campaign")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/promoters/add_to_campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 5594994,
"status": "active",
"cust_id": null,
"email": "wopomipu@mailinator.com",
"created_at": "2023-04-04T12:30:23.250Z",
"temp_password": "Pa$$w0rd!",
"default_promotion_id": 6041923,
"pref": "jme34om",
"default_ref_id": "cd5de",
"note": null,
"w8_form_url": null,
"w9_form_url": null,
"parent_promoter_id": null,
"earnings_balance": {
"cash": 30000
},
"current_balance": {
"credits": -150
},
"paid_balance": {
"cash": 30000,
"credits": 150
},
"auth_token": "cxXz22oP5xNG2bFcXzo13N8HQ91RYed2",
"profile": {
"id": 5629748,
"first_name": "Raven",
"last_name": "Moore",
"website": null,
"company_name": null,
"phone_number": null,
"address": null,
"vat_id": null,
"country": null,
"paypal_email": "nyhuxigyn@mailinator.com",
"avatar_url": null,
"description": null,
"social_accounts": {}
},
"promotions": [
{
"id": 10122408,
"status": "offer_inactive",
"ref_id": "s7rxl",
"promo_code": null,
"customer_promo_code": null,
"target_reached_at": null,
"promoter_id": 5594994,
"campaign_id": 18747,
"referral_link": "https://lastechworld.com?fpr=s7rxl",
"current_offer": null,
"current_referral_reward": {
"id": 94230,
"amount": 0,
"type": "per_referral",
"unit": "cash",
"name": "20% recurring commission",
"per_of_sale": 20,
"default_promo_code": ""
},
"current_promotion_reward": null,
"current_target_reward": null,
"campaign_name": "Publishers & marketing Partners",
"hidden": false,
"visitors_count": 0,
"leads_count": 0,
"customers_count": 0,
"refunds_count": 0,
"cancellations_count": 0,
"sales_count": 0,
"sales_total": 0,
"refunds_total": 0,
"active_customers_count": 0
},
{
"id": 10122364,
"status": "offer_running",
"ref_id": "4us60",
"promo_code": null,
"customer_promo_code": null,
"target_reached_at": null,
"promoter_id": 5594994,
"campaign_id": 26127,
"referral_link": "https://lastechworld.com?fpr=4us60",
"current_offer": {
"id": 140358,
"name": "1 free subscription months",
"amount": 1,
"unit": "free_months",
"default_promo_code": ""
},
"current_referral_reward": {
"id": 140359,
"amount": 1,
"type": "per_referral",
"unit": "free_months",
"name": "1 free subscription months",
"per_of_sale": 0,
"default_promo_code": ""
},
"current_promotion_reward": null,
"current_target_reward": null,
"campaign_name": "Make Campaign",
"hidden": false,
"visitors_count": 0,
"leads_count": 0,
"customers_count": 0,
"refunds_count": 0,
"cancellations_count": 0,
"sales_count": 0,
"sales_total": 0,
"refunds_total": 0,
"active_customers_count": 0
},
{
"id": 6041923,
"status": "offer_running",
"ref_id": "cd5de",
"promo_code": "",
"customer_promo_code": "",
"target_reached_at": null,
"promoter_id": 5594994,
"campaign_id": 18519,
"referral_link": "https://partner.lastechworld.com?fpr=cd5de",
"current_offer": {
"id": 96412,
"name": "75 credits",
"amount": 75,
"unit": "credits",
"default_promo_code": ""
},
"current_referral_reward": {
"id": 93868,
"amount": null,
"type": "per_referral",
"unit": "cash",
"name": "15% recurring commission",
"per_of_sale": 15,
"default_promo_code": null
},
"current_promotion_reward": null,
"current_target_reward": null,
"campaign_name": "TechScenario12Campaign-1",
"hidden": false,
"visitors_count": 1,
"leads_count": 1,
"customers_count": 1,
"refunds_count": 0,
"cancellations_count": 0,
"sales_count": 2,
"sales_total": 250000,
"refunds_total": 0,
"active_customers_count": 1
}
]
}"Bad credentials"{
"error": "Promoter not found."
}{
"error": "You need to find the promoter either by id, cust_id, auth_token, ref_id or promoter_email"
}Add a promoter to a campaign
Use this endpoint to add a promoter to another campaign. Your promoter can have multiple campaigns to promote, each with its own referral link and referral ID.
You can identify promoters by id, cust_id, auth_token, promoter_email or ref_id (referral id).
POST https://firstpromoter.com/api/v1/promoters/add_to_campaign curl --request POST \
--url https://firstpromoter.com/api/v1/promoters/add_to_campaign \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/promoters/add_to_campaign"
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/promoters/add_to_campaign', 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/promoters/add_to_campaign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/promoters/add_to_campaign"
req, _ := http.NewRequest("POST", 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.post("https://firstpromoter.com/api/v1/promoters/add_to_campaign")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/promoters/add_to_campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 5594994,
"status": "active",
"cust_id": null,
"email": "wopomipu@mailinator.com",
"created_at": "2023-04-04T12:30:23.250Z",
"temp_password": "Pa$$w0rd!",
"default_promotion_id": 6041923,
"pref": "jme34om",
"default_ref_id": "cd5de",
"note": null,
"w8_form_url": null,
"w9_form_url": null,
"parent_promoter_id": null,
"earnings_balance": {
"cash": 30000
},
"current_balance": {
"credits": -150
},
"paid_balance": {
"cash": 30000,
"credits": 150
},
"auth_token": "cxXz22oP5xNG2bFcXzo13N8HQ91RYed2",
"profile": {
"id": 5629748,
"first_name": "Raven",
"last_name": "Moore",
"website": null,
"company_name": null,
"phone_number": null,
"address": null,
"vat_id": null,
"country": null,
"paypal_email": "nyhuxigyn@mailinator.com",
"avatar_url": null,
"description": null,
"social_accounts": {}
},
"promotions": [
{
"id": 10122408,
"status": "offer_inactive",
"ref_id": "s7rxl",
"promo_code": null,
"customer_promo_code": null,
"target_reached_at": null,
"promoter_id": 5594994,
"campaign_id": 18747,
"referral_link": "https://lastechworld.com?fpr=s7rxl",
"current_offer": null,
"current_referral_reward": {
"id": 94230,
"amount": 0,
"type": "per_referral",
"unit": "cash",
"name": "20% recurring commission",
"per_of_sale": 20,
"default_promo_code": ""
},
"current_promotion_reward": null,
"current_target_reward": null,
"campaign_name": "Publishers & marketing Partners",
"hidden": false,
"visitors_count": 0,
"leads_count": 0,
"customers_count": 0,
"refunds_count": 0,
"cancellations_count": 0,
"sales_count": 0,
"sales_total": 0,
"refunds_total": 0,
"active_customers_count": 0
},
{
"id": 10122364,
"status": "offer_running",
"ref_id": "4us60",
"promo_code": null,
"customer_promo_code": null,
"target_reached_at": null,
"promoter_id": 5594994,
"campaign_id": 26127,
"referral_link": "https://lastechworld.com?fpr=4us60",
"current_offer": {
"id": 140358,
"name": "1 free subscription months",
"amount": 1,
"unit": "free_months",
"default_promo_code": ""
},
"current_referral_reward": {
"id": 140359,
"amount": 1,
"type": "per_referral",
"unit": "free_months",
"name": "1 free subscription months",
"per_of_sale": 0,
"default_promo_code": ""
},
"current_promotion_reward": null,
"current_target_reward": null,
"campaign_name": "Make Campaign",
"hidden": false,
"visitors_count": 0,
"leads_count": 0,
"customers_count": 0,
"refunds_count": 0,
"cancellations_count": 0,
"sales_count": 0,
"sales_total": 0,
"refunds_total": 0,
"active_customers_count": 0
},
{
"id": 6041923,
"status": "offer_running",
"ref_id": "cd5de",
"promo_code": "",
"customer_promo_code": "",
"target_reached_at": null,
"promoter_id": 5594994,
"campaign_id": 18519,
"referral_link": "https://partner.lastechworld.com?fpr=cd5de",
"current_offer": {
"id": 96412,
"name": "75 credits",
"amount": 75,
"unit": "credits",
"default_promo_code": ""
},
"current_referral_reward": {
"id": 93868,
"amount": null,
"type": "per_referral",
"unit": "cash",
"name": "15% recurring commission",
"per_of_sale": 15,
"default_promo_code": null
},
"current_promotion_reward": null,
"current_target_reward": null,
"campaign_name": "TechScenario12Campaign-1",
"hidden": false,
"visitors_count": 1,
"leads_count": 1,
"customers_count": 1,
"refunds_count": 0,
"cancellations_count": 0,
"sales_count": 2,
"sales_total": 250000,
"refunds_total": 0,
"active_customers_count": 1
}
]
}"Bad credentials"{
"error": "Promoter not found."
}{
"error": "You need to find the promoter either by id, cust_id, auth_token, ref_id or promoter_email"
}Authorizations
Query Parameters
Promoter's ID inside FirstPromoter
Email of the promoter
Assigned customer/user ID
Referral ID
Authentication token generated when the promoter was created
ID of the campaign to add the promoter to. It can be found on the url bar when editing the campaign
Response
Add to campaign response
The promoter's ID inside FirstPromoter
Promoter's status
approved, pending, denied Your customer's user ID inside your application/system for the promoter. This will be included in the webhook event and can be used to identify the promoter in your system if you subscribe for FirstPromoter's webhooks.
Promoter's email
ISO date string when the promoter signed up
A temporary password the promoter can use to log in to their dashboard if you don't use authentication tokens(auth_token) to sign promoters in automatically.
Promoter's default promotion id
128833
Promoter's parent referral id.
Promoter's default referral id
A note/description of promoter
The w8 form url
The w9 form url
Parent promoter id
Promoter's earnings balance. This object can contain cash, credits, discount_per
Show child attributes
Show child attributes
Promoter's current balance. This object can contain cash, credits, discount_per
Show child attributes
Show child attributes
Promoter's paid balance. This object can contain cash, credits, discount_per
Show child attributes
Show child attributes
Authentication token generated when the promoter was created
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Key-value pairs of custom fields configured for this promoter
Promo codes associated with this promoter
Show child attributes
Show child attributes