以标签 ID 或客户订单编号获取物流商托管的标签 URL
curl --request GET \
--url https://api.flexforwardship.com/labels/{id} \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>'import requests
url = "https://api.flexforwardship.com/labels/{id}"
headers = {
"x-rr-apikey": "<api-key>",
"x-rr-apitoken": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-rr-apikey': '<api-key>', 'x-rr-apitoken': '<api-key>'}
};
fetch('https://api.flexforwardship.com/labels/{id}', 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.flexforwardship.com/labels/{id}",
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-rr-apikey: <api-key>",
"x-rr-apitoken: <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://api.flexforwardship.com/labels/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rr-apikey", "<api-key>")
req.Header.Add("x-rr-apitoken", "<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://api.flexforwardship.com/labels/{id}")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flexforwardship.com/labels/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rr-apikey"] = '<api-key>'
request["x-rr-apitoken"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"customerOrderNumber": "N2026-05-13-TEST-01",
"url": "https://label-cdn.yunexpress.cn/labels/YT2503010001.pdf",
"labelFormat": "pdf"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}{
"error": "Label creation failed",
"errorCode": "COURIER_ERROR",
"errorMessage": "Address validation failed"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}标签
以标签 ID 或客户订单编号获取物流商托管的标签 URL
获取先前创建的标签文件 URL。可接受标签 UUID、customerOrderNumber 或以逗号分隔的标识符作为路径参数。批量请求会省略找不到或失败的标签。
GET
/
labels
/
{id}
以标签 ID 或客户订单编号获取物流商托管的标签 URL
curl --request GET \
--url https://api.flexforwardship.com/labels/{id} \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>'import requests
url = "https://api.flexforwardship.com/labels/{id}"
headers = {
"x-rr-apikey": "<api-key>",
"x-rr-apitoken": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-rr-apikey': '<api-key>', 'x-rr-apitoken': '<api-key>'}
};
fetch('https://api.flexforwardship.com/labels/{id}', 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.flexforwardship.com/labels/{id}",
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-rr-apikey: <api-key>",
"x-rr-apitoken: <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://api.flexforwardship.com/labels/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rr-apikey", "<api-key>")
req.Header.Add("x-rr-apitoken", "<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://api.flexforwardship.com/labels/{id}")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flexforwardship.com/labels/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rr-apikey"] = '<api-key>'
request["x-rr-apitoken"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"customerOrderNumber": "N2026-05-13-TEST-01",
"url": "https://label-cdn.yunexpress.cn/labels/YT2503010001.pdf",
"labelFormat": "pdf"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}{
"error": "Label creation failed",
"errorCode": "COURIER_ERROR",
"errorMessage": "Address validation failed"
}{
"error": "Shipping account not found",
"code": "COURIER_ERROR"
}路径参数
标签 UUID、客户订单编号或以逗号分隔的标识符。
Minimum string length:
1响应
Default Response
- Option 1
- Option 2
标签文件获取结果。
标签标识符。
示例:
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
与此标签关联的客户订单编号。
Minimum string length:
1示例:
"N2026-05-13-TEST-01"
标签文件下载 URL。
示例:
"https://label-cdn.yunexpress.cn/labels/YT2503010001.pdf"
文件格式(pdf 或 png)。
Minimum string length:
1示例:
"pdf"