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 banner or XML feed creative
Downloads one of the offer’s banner or XML feed creatives.
Banner (type: 1): the image is not sent through the API. The response is a 302 to a
presigned S3 URL valid for 5 minutes that downloads it as an attachment named after the banner
file. With redirect=0 that URL comes back as JSON instead (info.url, info.fileName), for
a client that does not follow redirects. A banner is the same for every affiliate, so affiliate_id
is not needed and is ignored.
XML feed (type: 4): the file is 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 the creative is neither a banner nor an XML feed
(Only banner and XML feed creatives are supported), and for an XML feed when
affiliate_id is missing or non-numeric, 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
Path Parameters
Query Parameters
Response
XML feed: the feed with the affiliate's tracking links injected, sent as a file attachment. Banner with redirect=0: the presigned download URL as JSON.
The response is of type file.
Was this page helpful?