Update promoter campaign
curl --request PUT \
--url https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id} \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ref_token": "<string>",
"coupon": "<string>",
"display_coupon": "<string>",
"direct_url": "<string>",
"rewards_for_promoters": [
{
"product_ids": [
123
],
"reward_id": 123
}
],
"rewards_for_referrals": [
{
"product_ids": [
123
],
"reward_id": 123
}
],
"promoter_rewards_customized": true,
"referral_rewards_customized": true
}
'import requests
url = "https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}"
payload = {
"ref_token": "<string>",
"coupon": "<string>",
"display_coupon": "<string>",
"direct_url": "<string>",
"rewards_for_promoters": [
{
"product_ids": [123],
"reward_id": 123
}
],
"rewards_for_referrals": [
{
"product_ids": [123],
"reward_id": 123
}
],
"promoter_rewards_customized": True,
"referral_rewards_customized": True
}
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Account-ID': '<account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ref_token: '<string>',
coupon: '<string>',
display_coupon: '<string>',
direct_url: '<string>',
rewards_for_promoters: [{product_ids: [123], reward_id: 123}],
rewards_for_referrals: [{product_ids: [123], reward_id: 123}],
promoter_rewards_customized: true,
referral_rewards_customized: true
})
};
fetch('https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ref_token' => '<string>',
'coupon' => '<string>',
'display_coupon' => '<string>',
'direct_url' => '<string>',
'rewards_for_promoters' => [
[
'product_ids' => [
123
],
'reward_id' => 123
]
],
'rewards_for_referrals' => [
[
'product_ids' => [
123
],
'reward_id' => 123
]
],
'promoter_rewards_customized' => true,
'referral_rewards_customized' => true
]),
CURLOPT_HTTPHEADER => [
"Account-ID: <account-id>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}"
payload := strings.NewReader("{\n \"ref_token\": \"<string>\",\n \"coupon\": \"<string>\",\n \"display_coupon\": \"<string>\",\n \"direct_url\": \"<string>\",\n \"rewards_for_promoters\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"rewards_for_referrals\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"promoter_rewards_customized\": true,\n \"referral_rewards_customized\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Account-ID", "<account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref_token\": \"<string>\",\n \"coupon\": \"<string>\",\n \"display_coupon\": \"<string>\",\n \"direct_url\": \"<string>\",\n \"rewards_for_promoters\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"rewards_for_referrals\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"promoter_rewards_customized\": true,\n \"referral_rewards_customized\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref_token\": \"<string>\",\n \"coupon\": \"<string>\",\n \"display_coupon\": \"<string>\",\n \"direct_url\": \"<string>\",\n \"rewards_for_promoters\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"rewards_for_referrals\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"promoter_rewards_customized\": true,\n \"referral_rewards_customized\": true\n}"
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": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}Promoter Campaigns
Update promoter campaign
With this endpoint you can update a promoter campaign.
HTTP Request
PUT https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}PUT
/
promoter_campaigns
/
{id}
Update promoter campaign
curl --request PUT \
--url https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id} \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ref_token": "<string>",
"coupon": "<string>",
"display_coupon": "<string>",
"direct_url": "<string>",
"rewards_for_promoters": [
{
"product_ids": [
123
],
"reward_id": 123
}
],
"rewards_for_referrals": [
{
"product_ids": [
123
],
"reward_id": 123
}
],
"promoter_rewards_customized": true,
"referral_rewards_customized": true
}
'import requests
url = "https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}"
payload = {
"ref_token": "<string>",
"coupon": "<string>",
"display_coupon": "<string>",
"direct_url": "<string>",
"rewards_for_promoters": [
{
"product_ids": [123],
"reward_id": 123
}
],
"rewards_for_referrals": [
{
"product_ids": [123],
"reward_id": 123
}
],
"promoter_rewards_customized": True,
"referral_rewards_customized": True
}
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Account-ID': '<account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ref_token: '<string>',
coupon: '<string>',
display_coupon: '<string>',
direct_url: '<string>',
rewards_for_promoters: [{product_ids: [123], reward_id: 123}],
rewards_for_referrals: [{product_ids: [123], reward_id: 123}],
promoter_rewards_customized: true,
referral_rewards_customized: true
})
};
fetch('https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ref_token' => '<string>',
'coupon' => '<string>',
'display_coupon' => '<string>',
'direct_url' => '<string>',
'rewards_for_promoters' => [
[
'product_ids' => [
123
],
'reward_id' => 123
]
],
'rewards_for_referrals' => [
[
'product_ids' => [
123
],
'reward_id' => 123
]
],
'promoter_rewards_customized' => true,
'referral_rewards_customized' => true
]),
CURLOPT_HTTPHEADER => [
"Account-ID: <account-id>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}"
payload := strings.NewReader("{\n \"ref_token\": \"<string>\",\n \"coupon\": \"<string>\",\n \"display_coupon\": \"<string>\",\n \"direct_url\": \"<string>\",\n \"rewards_for_promoters\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"rewards_for_referrals\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"promoter_rewards_customized\": true,\n \"referral_rewards_customized\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Account-ID", "<account-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref_token\": \"<string>\",\n \"coupon\": \"<string>\",\n \"display_coupon\": \"<string>\",\n \"direct_url\": \"<string>\",\n \"rewards_for_promoters\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"rewards_for_referrals\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"promoter_rewards_customized\": true,\n \"referral_rewards_customized\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref_token\": \"<string>\",\n \"coupon\": \"<string>\",\n \"display_coupon\": \"<string>\",\n \"direct_url\": \"<string>\",\n \"rewards_for_promoters\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"rewards_for_referrals\": [\n {\n \"product_ids\": [\n 123\n ],\n \"reward_id\": 123\n }\n ],\n \"promoter_rewards_customized\": true,\n \"referral_rewards_customized\": true\n}"
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": {}
}{
"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
Path Parameters
Promoter campaign ID. This ID is not the promoter’s ID or the campaign’s ID. It’s the linking record that defines the promoter’s participation in that campaign. You can find this id in each object in the promoter_campaigns array when you get the details of the promoter.
Body
application/json
Available options:
pending, accepted, rejected, blocked, inactive Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Updated promoter campaign
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