curl --request GET \
--url https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download \
--header 'X-API-Key: <api-key>'import requests
url = "https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download', 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://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download"
req, _ := http.NewRequest("GET", 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.get("https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"status": "error",
"code": 400,
"name": "Bad Request",
"message": "Request could not be parsed.",
"info": {
"errors": {}
}
}{
"status": "error",
"code": 401,
"name": "Unauthorized",
"message": "API key is invalid or missing."
}{
"status": "error",
"code": 403,
"name": "Forbidden",
"message": "This endpoint is not available for your role."
}{
"status": "error",
"code": 404,
"name": "Not Found",
"message": "Resource not found."
}{
"status": "error",
"code": 500,
"name": "Internal Server Error",
"message": "An unexpected error occurred.",
"info": {
"errors": {}
}
}Download XML feed creative on behalf of an affiliate
Downloads one of the offer’s XML feed creatives as a file, generated for the affiliate
given in affiliate_id — the same file that affiliate would download from their own
portal, so a manager can fetch it without logging in as them.
The feed is fetched from the creative’s xml_feed_url and every product URL inside it
is prefixed with the affiliate’s tracking link on the offer’s tracking domain, so
https://shop.example.com/p/1 becomes
https://track.example.com/click?o=<offer_id>&a=<affiliate_id>&deep_link=https://shop.example.com/p/1.
Which tag gets rewritten is read from the url_tag query parameter of the creative’s
xml_feed_url (for example https://example.com/feed.xml?url_tag=link); without it,
both <url> and <URL> are rewritten.
The response body is the file itself — assets_xml_<timestamp>.xml sent as an
attachment, not the usual {status, code, name, message, info} JSON envelope.
400 is returned when affiliate_id is missing or non-numeric, when the creative is
not an XML feed (Only XML feed creatives are supported), when the affiliate has no
approved access to the offer (Access not allowed), or when the feed cannot be fetched
from xml_feed_url (Failed to download XML feed: …). 404 Creative not found covers
every out-of-scope case alike: an unknown or inaccessible offer, an affiliate outside
the manager’s visibility scope, and a creative that does not belong to this offer.
curl --request GET \
--url https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download \
--header 'X-API-Key: <api-key>'import requests
url = "https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download', 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://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download"
req, _ := http.NewRequest("GET", 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.get("https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v2/network/offers/{offer_id}/creatives/{creative_id}/download")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"status": "error",
"code": 400,
"name": "Bad Request",
"message": "Request could not be parsed.",
"info": {
"errors": {}
}
}{
"status": "error",
"code": 401,
"name": "Unauthorized",
"message": "API key is invalid or missing."
}{
"status": "error",
"code": 403,
"name": "Forbidden",
"message": "This endpoint is not available for your role."
}{
"status": "error",
"code": 404,
"name": "Not Found",
"message": "Resource not found."
}{
"status": "error",
"code": 500,
"name": "Internal Server Error",
"message": "An unexpected error occurred.",
"info": {
"errors": {}
}
}Authorizations
Preferred authentication method. Pass the API key in the X-API-Key HTTP request header. The user account must have api_status enabled.
Path Parameters
Offer ID.
Creative ID. Must be an XML feed creative of this offer (type: 4 — xml_feed); any other type returns 400.
Query Parameters
ID of the affiliate the feed is generated for — their tracking link is injected into every product URL. The affiliate must have approved access to the offer.
Response
The XML feed with the affiliate's tracking links injected, sent as a file attachment.
The response is of type file.
Was this page helpful?