cURL
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"
}Promoters
Add a promoter to a campaign
Add an existing promoter to another campaign, giving them a separate referral link and ID for it (legacy v1 API).
POST
/
add_to_campaign
cURL
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"
}Use this endpoint to add a promoter to another campaign. Your promoter will have multiple campaigns to promoter, each campaign with its own promotion, referral link and referral id.
You can identify promoters by: id, cust_id, auth_token, promoter_email or ref_id(referral id).
Query Parameters
Response
Add to campaign response