Move referrals to promoter
curl --request POST \
--url https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"promoter_campaign_id": 123,
"ids": [
123
]
}
'import requests
url = "https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter"
payload = {
"promoter_campaign_id": 123,
"ids": [123]
}
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Account-ID': '<account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({promoter_campaign_id: 123, ids: [123]})
};
fetch('https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter', 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/referrals/move_to_promoter",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'promoter_campaign_id' => 123,
'ids' => [
123
]
]),
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/referrals/move_to_promoter"
payload := strings.NewReader("{\n \"promoter_campaign_id\": 123,\n \"ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"promoter_campaign_id\": 123,\n \"ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"promoter_campaign_id\": 123,\n \"ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "completed",
"total": 123,
"selected_total": 123,
"processed_count": 123,
"failed_count": 123,
"action_label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"meta": {},
"progress": 123,
"processing_errors": [
"<string>"
]
}{
"id": 123,
"status": "<string>",
"total": 123,
"selected_total": 123,
"processed_count": 123,
"failed_count": 123,
"action_label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"progress": 1,
"processing_errors": [
"<string>"
],
"meta": {}
}{}{
"message": "You don't have enough rights to perform this action",
"code": "<string>"
}{
"message": "<string>",
"code": "invalid_params"
}Referrals
Move referrals to promoter
With this endpoint you can move referrals to another promoter.
If there are more than 5 ids on the ids param/field, the action will be processed asynchronously. The response for the batch status will most likely be
in_progress. The available statuses are pending, in_progress, completed, failed and stoppedHTTP Request
POST https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoterPOST
/
referrals
/
move_to_promoter
Move referrals to promoter
curl --request POST \
--url https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter \
--header 'Account-ID: <account-id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"promoter_campaign_id": 123,
"ids": [
123
]
}
'import requests
url = "https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter"
payload = {
"promoter_campaign_id": 123,
"ids": [123]
}
headers = {
"Account-ID": "<account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Account-ID': '<account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({promoter_campaign_id: 123, ids: [123]})
};
fetch('https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter', 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/referrals/move_to_promoter",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'promoter_campaign_id' => 123,
'ids' => [
123
]
]),
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/referrals/move_to_promoter"
payload := strings.NewReader("{\n \"promoter_campaign_id\": 123,\n \"ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter")
.header("Account-ID", "<account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"promoter_campaign_id\": 123,\n \"ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firstpromoter.com/api/v2/company/referrals/move_to_promoter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Account-ID"] = '<account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"promoter_campaign_id\": 123,\n \"ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "completed",
"total": 123,
"selected_total": 123,
"processed_count": 123,
"failed_count": 123,
"action_label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"meta": {},
"progress": 123,
"processing_errors": [
"<string>"
]
}{
"id": 123,
"status": "<string>",
"total": 123,
"selected_total": 123,
"processed_count": 123,
"failed_count": 123,
"action_label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"progress": 1,
"processing_errors": [
"<string>"
],
"meta": {}
}{}{
"message": "You don't have enough rights to perform this action",
"code": "<string>"
}{
"message": "<string>",
"code": "invalid_params"
}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 → Manage API Keys
Headers
Account id. You can find your Account ID on Your FirstPromoter Dashboard. Navigate to Settings → Integrations
Body
application/json
Destination promoter campaign ID
Move associated commissions
Available options:
true, false Array of selected referral ids. If there are more than 5 ids on this param/field, the action will be processed asynchronously. The response for the batch status will most likely be in_progress. The available statuses are pending, in_progress, completed, failed and stopped
Response
Batch operation completed successfully.