Programs
Add an affiliate to a program
POST
/
programs
/
{program_id}
/
affiliates
/
Add an affiliate to a program
curl --request POST \
--url https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"affiliate_id": "mikemikerson",
"approved": null,
"coupon": "MIKEFREESHIPPING"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({affiliate_id: 'mikemikerson', approved: null, coupon: 'MIKEFREESHIPPING'})
};
fetch('https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/"
payload = {
"affiliate_id": "mikemikerson",
"approved": None,
"coupon": "MIKEFREESHIPPING"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/",
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([
'affiliate_id' => 'mikemikerson',
'approved' => null,
'coupon' => 'MIKEFREESHIPPING'
]),
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/programs/{program_id}/affiliates/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"affiliate_id\": \"mikemikerson\",\n \"approved\": null,\n \"coupon\": \"MIKEFREESHIPPING\"\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/programs/{program_id}/affiliates/"
payload := strings.NewReader("{\n \"affiliate_id\": \"mikemikerson\",\n \"approved\": null,\n \"coupon\": \"MIKEFREESHIPPING\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"affiliate_id\": \"mikemikerson\",\n \"approved\": null,\n \"coupon\": \"MIKEFREESHIPPING\"\n}")
.asString();{
"id": "sandrasanderson",
"firstname": "Mike",
"lastname": "Mikerson",
"email": "mike@example-parent.inc",
"company": null,
"address": null,
"meta_data": {},
"parent_id": null,
"referral_link": {
"link": "https://tapper.inc/johns-cool-product/?ref=ztdkzgf",
"asset_id": "1-aaaaaa",
"source_id": null
},
"coupon": "MIKEFREESHIPPING",
"approved": null,
"created_at": null,
"affiliate_group_id": null,
"applied_at": "2021-05-27T11:30:38+00:00",
"promoted_at": null,
"promotion_method": null,
"custom_fields": null
}{
"errors": [
{
"message": "Missing mandatory parameter(s)"
}
]
}{
"message": "Authentication Failed.",
"code": 401
}{
"message": "Forbidden",
"code": 403,
"traceId": "04ed655728a22bc0d39f"
}{
"message": "Not Found",
"code": 404,
"traceId": "7ae8e92b77572da03805"
}Authorizations
Your API key, from your Tapfiliate account settings.
Path Parameters
The id of the Program to add the affiliate too. This id can be found as part of the url when viewing the program on the platform.
Body
application/json
Response
OK
Show child attributes
Show child attributes
⌘I
Add an affiliate to a program
curl --request POST \
--url https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/ \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"affiliate_id": "mikemikerson",
"approved": null,
"coupon": "MIKEFREESHIPPING"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({affiliate_id: 'mikemikerson', approved: null, coupon: 'MIKEFREESHIPPING'})
};
fetch('https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/"
payload = {
"affiliate_id": "mikemikerson",
"approved": None,
"coupon": "MIKEFREESHIPPING"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/",
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([
'affiliate_id' => 'mikemikerson',
'approved' => null,
'coupon' => 'MIKEFREESHIPPING'
]),
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/programs/{program_id}/affiliates/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"affiliate_id\": \"mikemikerson\",\n \"approved\": null,\n \"coupon\": \"MIKEFREESHIPPING\"\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/programs/{program_id}/affiliates/"
payload := strings.NewReader("{\n \"affiliate_id\": \"mikemikerson\",\n \"approved\": null,\n \"coupon\": \"MIKEFREESHIPPING\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"affiliate_id\": \"mikemikerson\",\n \"approved\": null,\n \"coupon\": \"MIKEFREESHIPPING\"\n}")
.asString();{
"id": "sandrasanderson",
"firstname": "Mike",
"lastname": "Mikerson",
"email": "mike@example-parent.inc",
"company": null,
"address": null,
"meta_data": {},
"parent_id": null,
"referral_link": {
"link": "https://tapper.inc/johns-cool-product/?ref=ztdkzgf",
"asset_id": "1-aaaaaa",
"source_id": null
},
"coupon": "MIKEFREESHIPPING",
"approved": null,
"created_at": null,
"affiliate_group_id": null,
"applied_at": "2021-05-27T11:30:38+00:00",
"promoted_at": null,
"promotion_method": null,
"custom_fields": null
}{
"errors": [
{
"message": "Missing mandatory parameter(s)"
}
]
}{
"message": "Authentication Failed.",
"code": 401
}{
"message": "Forbidden",
"code": 403,
"traceId": "04ed655728a22bc0d39f"
}{
"message": "Not Found",
"code": 404,
"traceId": "7ae8e92b77572da03805"
}