Affiliates
Set affiliate group
Puts the affiliate in one of your affiliate groups (group_id), replacing its current group. An affiliate belongs to at most one group. Your Affiliate added to group triggers run only when the group actually changes.
Returns 400 Group not found for an unknown group id and 400 Missing mandatory parameter(s) when group_id is missing. Affiliate prospects return 403. Team members’ API keys need the Manage programs permission.
PUT
/
affiliates
/
{affiliate_id}
/
group
/
Set affiliate group
curl --request PUT \
--url https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"group_id": "ag_eXampl3"
}
'const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({group_id: 'ag_eXampl3'})
};
fetch('https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/"
payload = { "group_id": "ag_eXampl3" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/",
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([
'group_id' => 'ag_eXampl3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}require 'uri'
require 'net/http'
url = URI("https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"group_id\": \"ag_eXampl3\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/"
payload := strings.NewReader("{\n \"group_id\": \"ag_eXampl3\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"group_id\": \"ag_eXampl3\"\n}")
.asString();This response has no body data.{
"errors": [
{
"message": "Missing mandatory parameter(s)"
}
]
}{
"message": "Authentication Failed.",
"code": 401
}{
"message": "Forbidden",
"code": 403,
"traceId": "04ed655728a22bc0d39f"
}{
"message": "Not Found",
"code": 404,
"traceId": "7ae8e92b77572da03805"
}⌘I
Set affiliate group
curl --request PUT \
--url https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"group_id": "ag_eXampl3"
}
'const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({group_id: 'ag_eXampl3'})
};
fetch('https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/"
payload = { "group_id": "ag_eXampl3" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/",
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([
'group_id' => 'ag_eXampl3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}require 'uri'
require 'net/http'
url = URI("https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"group_id\": \"ag_eXampl3\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/"
payload := strings.NewReader("{\n \"group_id\": \"ag_eXampl3\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"group_id\": \"ag_eXampl3\"\n}")
.asString();This response has no body data.{
"errors": [
{
"message": "Missing mandatory parameter(s)"
}
]
}{
"message": "Authentication Failed.",
"code": 401
}{
"message": "Forbidden",
"code": 403,
"traceId": "04ed655728a22bc0d39f"
}{
"message": "Not Found",
"code": 404,
"traceId": "7ae8e92b77572da03805"
}