Get available promoter campaigns
curl --request GET \
--url https://api.firstpromoter.com/api/v2/company/promoter_campaigns \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firstpromoter.com/api/v2/company/promoter_campaigns"
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/promoter_campaigns', 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/promoter_campaigns",
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/promoter_campaigns"
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/promoter_campaigns")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/promoter_campaigns")
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[
{
"id": 123,
"campaign_id": 123,
"promoter_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"promoter": {
"id": 123,
"email": "<string>",
"name": "<string>"
},
"campaign": {
"id": 123,
"name": "<string>",
"color": "<string>"
},
"stats": {
"clicks_count": 123,
"referrals_count": 123,
"sales_count": 123,
"customers_count": 123,
"revenue_amount": 123
},
"coupon": "<string>",
"display_coupon": "<string>",
"ref_token": "<string>",
"ref_link": "<string>",
"is_customized": true,
"direct_url": "<string>",
"referral_rewards_customized": true,
"promoter_rewards_customized": true,
"rewards_for_promoters": [
{
"apply_on": "<string>",
"product_ids": [
123
],
"reward_id": 123,
"reward": {
"name": "<string>",
"promoter_reward_type": "<string>",
"hide_reward": true,
"tier_level": 123,
"coupon": "<string>"
},
"products": [
{
"id": 123,
"name": "<string>"
}
]
}
],
"rewards_for_referrals": [
{
"apply_on": "<string>",
"product_ids": [
123
],
"reward_id": 123,
"reward": {
"name": "<string>",
"promoter_reward_type": "<string>",
"hide_reward": true,
"tier_level": 123,
"coupon": "<string>"
},
"products": [
{
"id": 123,
"name": "<string>"
}
]
}
],
"promo_codes": [
"<string>"
]
}
]{
"message": "<string>",
"code": "<string>",
"errors": {}
}Promoter Campaigns
Get available promoter campaigns
With this endpoint you can list all promoter campaigns.
HTTP Request
GET https://api.firstpromoter.com/api/v2/company/promoter_campaignsGET
/
promoter_campaigns
Get available promoter campaigns
curl --request GET \
--url https://api.firstpromoter.com/api/v2/company/promoter_campaigns \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.firstpromoter.com/api/v2/company/promoter_campaigns"
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/promoter_campaigns', 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/promoter_campaigns",
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/promoter_campaigns"
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/promoter_campaigns")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/promoter_campaigns")
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[
{
"id": 123,
"campaign_id": 123,
"promoter_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"promoter": {
"id": 123,
"email": "<string>",
"name": "<string>"
},
"campaign": {
"id": 123,
"name": "<string>",
"color": "<string>"
},
"stats": {
"clicks_count": 123,
"referrals_count": 123,
"sales_count": 123,
"customers_count": 123,
"revenue_amount": 123
},
"coupon": "<string>",
"display_coupon": "<string>",
"ref_token": "<string>",
"ref_link": "<string>",
"is_customized": true,
"direct_url": "<string>",
"referral_rewards_customized": true,
"promoter_rewards_customized": true,
"rewards_for_promoters": [
{
"apply_on": "<string>",
"product_ids": [
123
],
"reward_id": 123,
"reward": {
"name": "<string>",
"promoter_reward_type": "<string>",
"hide_reward": true,
"tier_level": 123,
"coupon": "<string>"
},
"products": [
{
"id": 123,
"name": "<string>"
}
]
}
],
"rewards_for_referrals": [
{
"apply_on": "<string>",
"product_ids": [
123
],
"reward_id": 123,
"reward": {
"name": "<string>",
"promoter_reward_type": "<string>",
"hide_reward": true,
"tier_level": 123,
"coupon": "<string>"
},
"products": [
{
"id": 123,
"name": "<string>"
}
]
}
],
"promo_codes": [
"<string>"
]
}
]{
"message": "<string>",
"code": "<string>",
"errors": {}
}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 section → Manage API Keys
Headers
Account identifier that specifies which account is making the request
Response
List of promoter campaigns
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
pending, accepted, rejected, blocked, inactive Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I