cURL
curl --request PUT \
--url https://firstpromoter.com/api/v1/promoters/refresh_token \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/promoters/refresh_token"
headers = {"X-API-KEY": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/promoters/refresh_token', 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/refresh_token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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/refresh_token"
req, _ := http.NewRequest("PUT", 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.put("https://firstpromoter.com/api/v1/promoters/refresh_token")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/promoters/refresh_token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"auth_token": "4ktxi8sUeevM6BkNR1XXt2G5EAqCzhSu"
}"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
Reset promoter's authentication token
Resetting the authentication token (auth_token), which is used to automatically sign in your promoters (if you use this feature), is not required but can enhance the security of the promoter dashboard. You can set up a cron job to call the API endpoint and store the new auth_token from the response.
You can identify promoters by id, cust_id, or auth_token; only one is required.
HTTP Request
PUT https://firstpromoter.com/api/v1/promoters/refresh_token PUT
/
refresh_token
cURL
curl --request PUT \
--url https://firstpromoter.com/api/v1/promoters/refresh_token \
--header 'X-API-KEY: <api-key>'import requests
url = "https://firstpromoter.com/api/v1/promoters/refresh_token"
headers = {"X-API-KEY": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://firstpromoter.com/api/v1/promoters/refresh_token', 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/refresh_token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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/refresh_token"
req, _ := http.NewRequest("PUT", 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.put("https://firstpromoter.com/api/v1/promoters/refresh_token")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://firstpromoter.com/api/v1/promoters/refresh_token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"auth_token": "4ktxi8sUeevM6BkNR1XXt2G5EAqCzhSu"
}"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"
}Resetting authentication token(auth_token) which is used to automatically sign in your promoters(if you use this feature) is not required, but can be used to enhance the security of the promoter dashboard. You can set up a cron job to call the API endpoint and store the new “auth_token” from the response.
You can identify promoters by: id, cust_id or auth_token…only one required.
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
Response
Refresh Token response
Example:
"4ktxi8sUeevM6BkNR1XXt2G5EAqCzhSu"