Update the tags of partners
curl --request POST \
--url https://api.dub.co/partners/update-tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"partnerIds": [
"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD"
],
"addTagIds": [
"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD"
]
}
'import requests
url = "https://api.dub.co/partners/update-tags"
payload = {
"partnerIds": ["pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD"],
"addTagIds": ["ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partnerIds: ['pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD'],
addTagIds: ['ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD']
})
};
fetch('https://api.dub.co/partners/update-tags', 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.dub.co/partners/update-tags",
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([
'partnerIds' => [
'pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD'
],
'addTagIds' => [
'ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD'
]
]),
CURLOPT_HTTPHEADER => [
"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.dub.co/partners/update-tags"
payload := strings.NewReader("{\n \"partnerIds\": [\n \"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ],\n \"addTagIds\": [\n \"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.dub.co/partners/update-tags")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"partnerIds\": [\n \"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ],\n \"addTagIds\": [\n \"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dub.co/partners/update-tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partnerIds\": [\n \"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ],\n \"addTagIds\": [\n \"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"added": 123,
"removed": 123
}{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}Partners
Update partner tags
Add and remove partner tags on up to 100 partners enrolled in your program. Tags that a partner already has are not added again, and tags a partner does not have are skipped on removal. The call fails without changes if any partner is not enrolled in your program or any tag is not in your program.
POST
/
partners
/
update-tags
Update the tags of partners
curl --request POST \
--url https://api.dub.co/partners/update-tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"partnerIds": [
"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD"
],
"addTagIds": [
"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD"
]
}
'import requests
url = "https://api.dub.co/partners/update-tags"
payload = {
"partnerIds": ["pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD"],
"addTagIds": ["ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partnerIds: ['pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD'],
addTagIds: ['ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD']
})
};
fetch('https://api.dub.co/partners/update-tags', 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.dub.co/partners/update-tags",
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([
'partnerIds' => [
'pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD'
],
'addTagIds' => [
'ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD'
]
]),
CURLOPT_HTTPHEADER => [
"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.dub.co/partners/update-tags"
payload := strings.NewReader("{\n \"partnerIds\": [\n \"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ],\n \"addTagIds\": [\n \"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.dub.co/partners/update-tags")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"partnerIds\": [\n \"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ],\n \"addTagIds\": [\n \"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dub.co/partners/update-tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partnerIds\": [\n \"pn_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ],\n \"addTagIds\": [\n \"ptag_1JRQ9DY1X0PDS2G0WGZ7EYTXD\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"added": 123,
"removed": 123
}{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}Body
application/json
Was this page helpful?