Create an attribution link
curl --request POST \
--url https://app.openlight.tech/api/creator/v1/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_id": "<string>",
"product_id": "<string>",
"destination_url": "<string>",
"tracking_id": "<string>"
}
'import requests
url = "https://app.openlight.tech/api/creator/v1/links"
payload = {
"brand_id": "<string>",
"product_id": "<string>",
"destination_url": "<string>",
"tracking_id": "<string>"
}
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({
brand_id: '<string>',
product_id: '<string>',
destination_url: '<string>',
tracking_id: '<string>'
})
};
fetch('https://app.openlight.tech/api/creator/v1/links', 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://app.openlight.tech/api/creator/v1/links",
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([
'brand_id' => '<string>',
'product_id' => '<string>',
'destination_url' => '<string>',
'tracking_id' => '<string>'
]),
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://app.openlight.tech/api/creator/v1/links"
payload := strings.NewReader("{\n \"brand_id\": \"<string>\",\n \"product_id\": \"<string>\",\n \"destination_url\": \"<string>\",\n \"tracking_id\": \"<string>\"\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://app.openlight.tech/api/creator/v1/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_id\": \"<string>\",\n \"product_id\": \"<string>\",\n \"destination_url\": \"<string>\",\n \"tracking_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.openlight.tech/api/creator/v1/links")
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 \"brand_id\": \"<string>\",\n \"product_id\": \"<string>\",\n \"destination_url\": \"<string>\",\n \"tracking_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"link": {
"id": "<string>",
"brand_id": "<string>",
"product_id": "<string>",
"url": "<string>",
"destination_url": "<string>",
"marketplace": "<string>",
"tracking_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}
}链接
创建归因链接
为指定品牌商品创建推广归因链接
POST
/
api
/
creator
/
v1
/
links
Create an attribution link
curl --request POST \
--url https://app.openlight.tech/api/creator/v1/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_id": "<string>",
"product_id": "<string>",
"destination_url": "<string>",
"tracking_id": "<string>"
}
'import requests
url = "https://app.openlight.tech/api/creator/v1/links"
payload = {
"brand_id": "<string>",
"product_id": "<string>",
"destination_url": "<string>",
"tracking_id": "<string>"
}
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({
brand_id: '<string>',
product_id: '<string>',
destination_url: '<string>',
tracking_id: '<string>'
})
};
fetch('https://app.openlight.tech/api/creator/v1/links', 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://app.openlight.tech/api/creator/v1/links",
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([
'brand_id' => '<string>',
'product_id' => '<string>',
'destination_url' => '<string>',
'tracking_id' => '<string>'
]),
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://app.openlight.tech/api/creator/v1/links"
payload := strings.NewReader("{\n \"brand_id\": \"<string>\",\n \"product_id\": \"<string>\",\n \"destination_url\": \"<string>\",\n \"tracking_id\": \"<string>\"\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://app.openlight.tech/api/creator/v1/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_id\": \"<string>\",\n \"product_id\": \"<string>\",\n \"destination_url\": \"<string>\",\n \"tracking_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.openlight.tech/api/creator/v1/links")
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 \"brand_id\": \"<string>\",\n \"product_id\": \"<string>\",\n \"destination_url\": \"<string>\",\n \"tracking_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"link": {
"id": "<string>",
"brand_id": "<string>",
"product_id": "<string>",
"url": "<string>",
"destination_url": "<string>",
"marketplace": "<string>",
"tracking_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
}
}使用该接口为某个品牌商品创建推广归因链接。请求必须包含
brand_id 和 product_id,也可以传入可选的 tracking_id、destination_url。
字段说明:
tracking_id:客户侧追踪标识,最多 200 个字符。建议把下游系统里的 tag、campaign、source 等追踪值放在这里;前后空白会被裁剪,不能包含 ASCII 控制字符。创建成功后会在创建响应和列表响应中返回规范化后的值,后续报表也会使用该字段做下游归因。destination_url:Amazon 落地页 URL,可选。未传入时默认使用商品详情页;它决定用户点击后进入哪个 Amazon 页面,不承担追踪 tag 的作用。
201 和 { "link": LinkDTO }。
创建成功后,响应里的 marketplace 会返回该链接对应的 Amazon 站点域名,例如 amazon.com、amazon.co.uk、amazon.de。该字段用于判断链接所属站点,不表示合作状态,也不是追踪 tag。
可能的错误:
400 invalid_request:请求体不完整或字段无效。403 forbidden_resource:当前 Token owner 无权访问该品牌或商品。403 ads_not_connected:品牌广告连接状态不满足创建要求。404 product_not_found:商品不存在或不可访问。
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
品牌 ID。Brand ID.
商品 ID。Product ID.
Amazon 落地页 URL;可选,默认使用商品详情页。Amazon landing page URL; optional, defaults to the product detail page.
客户侧追踪标识;可选,前后空白会被裁剪,不能包含 ASCII 控制字符。创建和列表响应会返回规范化后的值,后续报表也会使用该字段做下游归因。Client-side tracking tag; optional, leading/trailing whitespace is trimmed and ASCII control characters are rejected. Create/list responses return the normalized value, intended for downstream reporting.
Maximum string length:
200响应
Attribution link created
Show child attributes
Show child attributes