开始使用参数
使用专用API代币,首先验证测试数据的读取操作.
- 保存代币服务器侧,然后将其发送到Authorization标题中.
- 检查所需参数,并扩大请求或响应方案.
- 在应用错误中处理HTTP状态和稳定的error字段.
通过可编辑的独立合同来支持本页面. 在生产使用之前,验证使用测试数据的写作操作.
/api/param
准备使用的工作流程
使用专用API代币,首先验证测试数据的读取操作.
数据模型
模型在此列出一次,并且可以直接从使用它们的终端点扩展.
idinteger · int32Id.
namestring姓名.
nationalCatalogIdinteger · int64标签:国家目录
wildberriesTypeIdinteger · int64野生类型的身份证.
aliexpressCategoryIdinteger · int64标签: 标识:
unitsUnit[]单位.
unitsMapobject单位地图.
measureIdinteger · int32测量ID.
idinteger · int64Id.
namestring姓名.
paramIdinteger · int64位名单.
ozonIdinteger · int64气标识.
wildberriesIdinteger · int64果的身份证.
ymIdinteger · int64您的身份.
aliexpressIdinteger · int64快递证件
clientIdinteger · int64客户身份证.
deletedboolean删除了.
oneCIdstring一个公告.
dictionaryboolean字典.
optionIdOption选择ID.
namestring姓名.
titlestring标题
publishedboolean发表了.
visibleboolean显而易见.
serviceParamstring服务部.
servicestring服务.
useCategoryOptionboolean使用类别选项.
valueTypestring值类型
displayTypestring显示类型.
requiredboolean需要.
multiValueAllowedboolean允许多值.
maxValuesCountinteger · int32极值值计算.
useDictionaryboolean使用字典.
descriptionstring描述
groupNamestring组名
groupIdstring组身份证.
ozonDictionaryIdinteger · int64子词典ID
dictionaryIdinteger · int64字典名单
measureIdinteger · int32测量ID.
measureMeasure测量.
defaultUnitUnit默认单位.
ozonIdinteger · int64气标识.
wildberriesIdinteger · int64果的身份证.
ymIdinteger · int64您的身份.
lamodaIdstring拉莫达的身份.
nationalCatalogIdinteger · int64标签:国家目录
categoryIdinteger · int64类别的ID.
avitoIdsinteger[]果的身份证.
avitoOptionsXmlFileNamestring维托选项Xml文件名称
clientIdinteger · int64客户身份证.
createdDatestring · date-time创造日期.
aliexpressIdinteger · int64快递证件
presetstring预设.
dictionaryParamIdinteger · int64字典 帕拉姆 标识
dictionaryKeystring词典关键.
levelstring水平.
gs1Classstring士1级.
useAllCategoriesboolean使用所有类别.
oneCIdstring一个公告.
optionsOption[]选择.
optionsCacheCacheStringOption选择缓存.
lastRefreshOptionsinteger · int64最后更新选项.
optionsCountinteger · int32选择是重要的.
isAnalyticboolean是分析师.
analyticOrderinteger · int32分析命令.
marketplaceServicestring市场服务.
idinteger · int64Id.
namestring姓名.
measureIdinteger · int32测量ID.
idinteger · int32Id.
numberstring号码.
apiversioninteger · int32炼.
resultSuggestParam[]结果.
emptyboolean没有任何东西.
错误合同
编程的代码在每个地方都相同,而用户面向的消息由服务器翻译. 建立在error周围的应用逻辑,仅用于显示.
鱼类稳定机器可读的代码用于集成逻辑.
鱼类在API代币用户语言中显示准备的消息.
鱼类服务器在本地化消息模板中插入的值.
localMessage使用了 API代币的用户的lang字段.文档语言和 Accept-Language标题不会改变它;当用户没有语言配置时,使用俄语.
{
"error": "error_brand_already_exists",
"localMessage": "Бренд Base уже существует",
"params": {
"name": "Base"
}
}{
"error": "error_brand_already_exists",
"localMessage": "品牌 Base 已经存在",
"params": {
"name": "Base"
}
}终点
/api/param/使用 POST /api/param/. 的后台
application/jsonParam| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | 否 | 姓名. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title |
string | 否 | 标题 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
published |
boolean | 否 | 发表了. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
visible |
boolean | 否 | 显而易见. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
serviceParam |
stringNAME, MODEL_NAME, MAIN_IMAGE_URL, TNVED, RICH_CONTENT, DESCRIPTION, TNVED_GROUP, MATERIALS, GENDER, IMAGES, BRAND, PACK_WEIGHT_GR, PACK_WEIGHT_KG, MADE_IN_COUNTRY, MARKING, WILDBERRIES_ARTICLE, WILDBERRIES_COLOR, WILDBERRIES_SIZE, REAL_SIZE, PACK_WIDTH, PACK_HEIGHT, PACK_DEPTH, PACK_LENGTH, MANUFACTURER, MEASURES, DOCUMENT_LINK, DOCUMENT_NAME, KEYWORDS, SEASON, ARTICLE, COLOR, SIZE, MATERIALS_WB, LAUNDRY | 否 | 服务部. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
service |
stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC | 否 | 服务. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useCategoryOption |
boolean | 否 | 使用类别选项. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
valueType |
stringBOOLEAN, LONG, DOUBLE, ENUM, TEXT, DATE | 否 | 值类型 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
displayType |
stringSELECT, SUGGEST, TEXT, CHECKBOX, LONGTEXT | 否 | 显示类型. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required |
boolean | 否 | 需要. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
multiValueAllowed |
boolean | 否 | 允许多值. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maxValuesCount |
integer · int32 | 否 | 极值值计算. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useDictionary |
boolean | 否 | 使用字典. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description |
string | 否 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupName |
string | 否 | 组名 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupId |
string | 否 | 组身份证. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ozonDictionaryId |
integer · int64 | 否 | 子词典ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dictionaryId |
integer · int64 | 否 | 字典名单 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measureId |
integer · int32 | 否 | 测量ID. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measure |
Measure | 否 | 测量. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
对象场
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
integer · int32 | 否 | Id. | ||||||||||||||||
name |
string | 否 | 姓名. | ||||||||||||||||
nationalCatalogId |
integer · int64 | 否 | 标签:国家目录 | ||||||||||||||||
wildberriesTypeId |
integer · int64 | 否 | 野生类型的身份证. | ||||||||||||||||
aliexpressCategoryId |
integer · int64 | 否 | 标签: 标识: | ||||||||||||||||
units |
Unit[] | 否 | 单位. | ||||||||||||||||
阵列项结构
|
|||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
unitsMapmeasureIddefaultUnitUnit
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
ozonIdwildberriesIdymIdlamodaIdnationalCatalogIdcategoryIdavitoIdsavitoOptionsXmlFileNameclientIdcreatedDatealiexpressIdpresetdictionaryParamIddictionaryKeylevelgs1ClassuseAllCategoriesoneCIdoptionsOption
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
id |
integer · int64 | 否 | Id. |
name |
string | 否 | 姓名. |
paramId |
integer · int64 | 否 | 位名单. |
ozonId |
integer · int64 | 否 | 气标识. |
wildberriesId |
integer · int64 | 否 | 果的身份证. |
ymId |
integer · int64 | 否 | 您的身份. |
aliexpressId |
integer · int64 | 否 | 快递证件 |
clientId |
integer · int64 | 否 | 客户身份证. |
deleted |
boolean | 否 | 删除了. |
oneCId |
string | 否 | 一个公告. |
dictionary |
boolean | 否 | 字典. |
optionId |
Option | 否 | 选择ID. |
optionsCachelastRefreshOptionsoptionsCountisAnalyticanalyticOrdermarketplaceServiceidcurl --request POST 'https://api.selsup.ru/api/param/' \
--header 'Authorization: YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}'
const response = await fetch('https://api.selsup.ru/api/param/', {
method: 'POST',
headers: {
Authorization: process.env.SELSUP_API_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}),
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'selsup_request_failed');
}
const result = await response.json();
const response: Response = await fetch('https://api.selsup.ru/api/param/', {
method: 'POST',
headers: {
Authorization: process.env.SELSUP_API_TOKEN!,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}),
});
if (!response.ok) {
const error = await response.json() as { error?: string };
throw new Error(error.error ?? 'selsup_request_failed');
}
const result: unknown = await response.json();
import os
import requests
response = requests.post(
'https://api.selsup.ru/api/param/',
headers={'Authorization': os.environ['SELSUP_API_TOKEN']},
json={
'name': 'Example',
'title': 'Example',
'published': False,
'visible': False,
'serviceParam': 'NAME',
'service': 'NONE'
},
)
response.raise_for_status()
result = response.json()
<?php
$payload = <<<'JSON'
{
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}
JSON;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.selsup.ru/api/param/',
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: ' . getenv('SELSUP_API_TOKEN'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($response === false || $status >= 400) {
throw new RuntimeException($response ?: 'selsup_request_failed');
}
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, err := http.NewRequest("POST", "https://api.selsup.ru/api/param/", strings.NewReader(`{
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}`))
if err != nil { panic(err) }
req.Header.Set("Authorization", os.Getenv("SELSUP_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
response, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer response.Body.Close()
result, _ := io.ReadAll(response.Body)
fmt.Printf("%d\n%s\n", response.StatusCode, result)
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SelSupExample {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.selsup.ru/api/param/"))
.header("Authorization", System.getenv("SELSUP_API_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}
"""))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
Param
| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | 否 | 姓名. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title |
string | 否 | 标题 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
published |
boolean | 否 | 发表了. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
visible |
boolean | 否 | 显而易见. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
serviceParam |
stringNAME, MODEL_NAME, MAIN_IMAGE_URL, TNVED, RICH_CONTENT, DESCRIPTION, TNVED_GROUP, MATERIALS, GENDER, IMAGES, BRAND, PACK_WEIGHT_GR, PACK_WEIGHT_KG, MADE_IN_COUNTRY, MARKING, WILDBERRIES_ARTICLE, WILDBERRIES_COLOR, WILDBERRIES_SIZE, REAL_SIZE, PACK_WIDTH, PACK_HEIGHT, PACK_DEPTH, PACK_LENGTH, MANUFACTURER, MEASURES, DOCUMENT_LINK, DOCUMENT_NAME, KEYWORDS, SEASON, ARTICLE, COLOR, SIZE, MATERIALS_WB, LAUNDRY | 否 | 服务部. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
service |
stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC | 否 | 服务. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useCategoryOption |
boolean | 否 | 使用类别选项. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
valueType |
stringBOOLEAN, LONG, DOUBLE, ENUM, TEXT, DATE | 否 | 值类型 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
displayType |
stringSELECT, SUGGEST, TEXT, CHECKBOX, LONGTEXT | 否 | 显示类型. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required |
boolean | 否 | 需要. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
multiValueAllowed |
boolean | 否 | 允许多值. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maxValuesCount |
integer · int32 | 否 | 极值值计算. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useDictionary |
boolean | 否 | 使用字典. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description |
string | 否 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupName |
string | 否 | 组名 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupId |
string | 否 | 组身份证. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ozonDictionaryId |
integer · int64 | 否 | 子词典ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dictionaryId |
integer · int64 | 否 | 字典名单 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measureId |
integer · int32 | 否 | 测量ID. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measure |
Measure | 否 | 测量. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
对象场
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
integer · int32 | 否 | Id. | ||||||||||||||||
name |
string | 否 | 姓名. | ||||||||||||||||
nationalCatalogId |
integer · int64 | 否 | 标签:国家目录 | ||||||||||||||||
wildberriesTypeId |
integer · int64 | 否 | 野生类型的身份证. | ||||||||||||||||
aliexpressCategoryId |
integer · int64 | 否 | 标签: 标识: | ||||||||||||||||
units |
Unit[] | 否 | 单位. | ||||||||||||||||
阵列项结构
|
|||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
unitsMapmeasureIddefaultUnitUnit
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
ozonIdwildberriesIdymIdlamodaIdnationalCatalogIdcategoryIdavitoIdsavitoOptionsXmlFileNameclientIdcreatedDatealiexpressIdpresetdictionaryParamIddictionaryKeylevelgs1ClassuseAllCategoriesoneCIdoptionsOption
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
id |
integer · int64 | 否 | Id. |
name |
string | 否 | 姓名. |
paramId |
integer · int64 | 否 | 位名单. |
ozonId |
integer · int64 | 否 | 气标识. |
wildberriesId |
integer · int64 | 否 | 果的身份证. |
ymId |
integer · int64 | 否 | 您的身份. |
aliexpressId |
integer · int64 | 否 | 快递证件 |
clientId |
integer · int64 | 否 | 客户身份证. |
deleted |
boolean | 否 | 删除了. |
oneCId |
string | 否 | 一个公告. |
dictionary |
boolean | 否 | 字典. |
optionId |
Option | 否 | 选择ID. |
optionsCachelastRefreshOptionsoptionsCountisAnalyticanalyticOrdermarketplaceServiceid{
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
error_param_empty_display_type应用逻辑中使用稳定的error_param_empty_display_type代码;localMessage包含上述翻译.
error_param_empty_level应用逻辑中使用稳定的error_param_empty_level代码;localMessage包含上述翻译.
error_param_empty_name应用逻辑中使用稳定的error_param_empty_name代码;localMessage包含上述翻译.
error_param_empty_value_type应用逻辑中使用稳定的error_param_empty_value_type代码;localMessage包含上述翻译.
error_subscription_expired应用逻辑中使用稳定的error_subscription_expired代码;localMessage包含上述翻译.
/api/param/{id}使用 GET /api/param/{id}.的参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
id |
integer · int64 | 是 | Id. |
curl --request GET 'https://api.selsup.ru/api/param/1001' \
--header 'Authorization: YOUR_API_TOKEN'
const response = await fetch('https://api.selsup.ru/api/param/1001', {
method: 'GET',
headers: { Authorization: process.env.SELSUP_API_TOKEN },
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'selsup_request_failed');
}
const result = await response.json();
const response: Response = await fetch('https://api.selsup.ru/api/param/1001', {
method: 'GET',
headers: { Authorization: process.env.SELSUP_API_TOKEN! },
});
if (!response.ok) {
const error = await response.json() as { error?: string };
throw new Error(error.error ?? 'selsup_request_failed');
}
const result: unknown = await response.json();
import os
import requests
response = requests.get(
'https://api.selsup.ru/api/param/1001',
headers={'Authorization': os.environ['SELSUP_API_TOKEN']},
)
response.raise_for_status()
result = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.selsup.ru/api/param/1001',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: ' . getenv('SELSUP_API_TOKEN')],
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($response === false || $status >= 400) {
throw new RuntimeException($response ?: 'selsup_request_failed');
}
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.selsup.ru/api/param/1001", nil)
if err != nil { panic(err) }
req.Header.Set("Authorization", os.Getenv("SELSUP_API_TOKEN"))
response, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer response.Body.Close()
result, _ := io.ReadAll(response.Body)
fmt.Printf("%d\n%s\n", response.StatusCode, result)
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SelSupExample {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.selsup.ru/api/param/1001"))
.header("Authorization", System.getenv("SELSUP_API_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
Param
| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | 否 | 姓名. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title |
string | 否 | 标题 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
published |
boolean | 否 | 发表了. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
visible |
boolean | 否 | 显而易见. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
serviceParam |
stringNAME, MODEL_NAME, MAIN_IMAGE_URL, TNVED, RICH_CONTENT, DESCRIPTION, TNVED_GROUP, MATERIALS, GENDER, IMAGES, BRAND, PACK_WEIGHT_GR, PACK_WEIGHT_KG, MADE_IN_COUNTRY, MARKING, WILDBERRIES_ARTICLE, WILDBERRIES_COLOR, WILDBERRIES_SIZE, REAL_SIZE, PACK_WIDTH, PACK_HEIGHT, PACK_DEPTH, PACK_LENGTH, MANUFACTURER, MEASURES, DOCUMENT_LINK, DOCUMENT_NAME, KEYWORDS, SEASON, ARTICLE, COLOR, SIZE, MATERIALS_WB, LAUNDRY | 否 | 服务部. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
service |
stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC | 否 | 服务. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useCategoryOption |
boolean | 否 | 使用类别选项. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
valueType |
stringBOOLEAN, LONG, DOUBLE, ENUM, TEXT, DATE | 否 | 值类型 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
displayType |
stringSELECT, SUGGEST, TEXT, CHECKBOX, LONGTEXT | 否 | 显示类型. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required |
boolean | 否 | 需要. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
multiValueAllowed |
boolean | 否 | 允许多值. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maxValuesCount |
integer · int32 | 否 | 极值值计算. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useDictionary |
boolean | 否 | 使用字典. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description |
string | 否 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupName |
string | 否 | 组名 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupId |
string | 否 | 组身份证. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ozonDictionaryId |
integer · int64 | 否 | 子词典ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dictionaryId |
integer · int64 | 否 | 字典名单 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measureId |
integer · int32 | 否 | 测量ID. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measure |
Measure | 否 | 测量. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
对象场
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
integer · int32 | 否 | Id. | ||||||||||||||||
name |
string | 否 | 姓名. | ||||||||||||||||
nationalCatalogId |
integer · int64 | 否 | 标签:国家目录 | ||||||||||||||||
wildberriesTypeId |
integer · int64 | 否 | 野生类型的身份证. | ||||||||||||||||
aliexpressCategoryId |
integer · int64 | 否 | 标签: 标识: | ||||||||||||||||
units |
Unit[] | 否 | 单位. | ||||||||||||||||
阵列项结构
|
|||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
unitsMapmeasureIddefaultUnitUnit
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
ozonIdwildberriesIdymIdlamodaIdnationalCatalogIdcategoryIdavitoIdsavitoOptionsXmlFileNameclientIdcreatedDatealiexpressIdpresetdictionaryParamIddictionaryKeylevelgs1ClassuseAllCategoriesoneCIdoptionsOption
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
id |
integer · int64 | 否 | Id. |
name |
string | 否 | 姓名. |
paramId |
integer · int64 | 否 | 位名单. |
ozonId |
integer · int64 | 否 | 气标识. |
wildberriesId |
integer · int64 | 否 | 果的身份证. |
ymId |
integer · int64 | 否 | 您的身份. |
aliexpressId |
integer · int64 | 否 | 快递证件 |
clientId |
integer · int64 | 否 | 客户身份证. |
deleted |
boolean | 否 | 删除了. |
oneCId |
string | 否 | 一个公告. |
dictionary |
boolean | 否 | 字典. |
optionId |
Option | 否 | 选择ID. |
optionsCachelastRefreshOptionsoptionsCountisAnalyticanalyticOrdermarketplaceServiceid{
"name": "Example",
"title": "Example",
"published": false,
"visible": false,
"serviceParam": "NAME",
"service": "NONE"
}应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
error_no_client应用逻辑中使用稳定的error_no_client代码;localMessage包含上述翻译.
error_not_found_param_by_id应用逻辑中使用稳定的error_not_found_param_by_id代码;localMessage包含上述翻译.
/api/param/preset/{service}/{organizationId}/{preset}获取Param建议使用GET/api/param/preset/{service}/{organizationId}/{preset}.
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
service |
stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC | 是 | 服务. |
preset |
stringSUGGEST_REQUIRED | 是 | 预设. |
organizationId |
integer · int64 | 是 | 组织身份证. |
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
attrId |
integer · int64 | 是 | 检查人员. |
number |
string | 是 | 号码. |
curl --request GET 'https://api.selsup.ru/api/param/preset/NONE/1001/SUGGEST_REQUIRED?attrId=1001&number=string' \
--header 'Authorization: YOUR_API_TOKEN'
const response = await fetch('https://api.selsup.ru/api/param/preset/NONE/1001/SUGGEST_REQUIRED?attrId=1001&number=string', {
method: 'GET',
headers: { Authorization: process.env.SELSUP_API_TOKEN },
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'selsup_request_failed');
}
const result = await response.json();
const response: Response = await fetch('https://api.selsup.ru/api/param/preset/NONE/1001/SUGGEST_REQUIRED?attrId=1001&number=string', {
method: 'GET',
headers: { Authorization: process.env.SELSUP_API_TOKEN! },
});
if (!response.ok) {
const error = await response.json() as { error?: string };
throw new Error(error.error ?? 'selsup_request_failed');
}
const result: unknown = await response.json();
import os
import requests
response = requests.get(
'https://api.selsup.ru/api/param/preset/NONE/1001/SUGGEST_REQUIRED?attrId=1001&number=string',
headers={'Authorization': os.environ['SELSUP_API_TOKEN']},
)
response.raise_for_status()
result = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.selsup.ru/api/param/preset/NONE/1001/SUGGEST_REQUIRED?attrId=1001&number=string',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: ' . getenv('SELSUP_API_TOKEN')],
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($response === false || $status >= 400) {
throw new RuntimeException($response ?: 'selsup_request_failed');
}
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.selsup.ru/api/param/preset/NONE/1001/SUGGEST_REQUIRED?attrId=1001&number=string", nil)
if err != nil { panic(err) }
req.Header.Set("Authorization", os.Getenv("SELSUP_API_TOKEN"))
response, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer response.Body.Close()
result, _ := io.ReadAll(response.Body)
fmt.Printf("%d\n%s\n", response.StatusCode, result)
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SelSupExample {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.selsup.ru/api/param/preset/NONE/1001/SUGGEST_REQUIRED?attrId=1001&number=string"))
.header("Authorization", System.getenv("SELSUP_API_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
SuggestResponse
| 字段 | 类型 | 必填 | 描述 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
apiversion |
integer · int32 | 否 | 炼. | ||||||||
result |
SuggestParam[] | 否 | 结果. | ||||||||
阵列项结构
|
|||||||||||
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
number |
string | 否 | 号码. |
empty{
"apiversion": 1,
"result": "string",
"empty": false
}应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
error_no_integration_with_nc应用逻辑中使用稳定的error_no_integration_with_nc代码;localMessage包含上述翻译.
error_service_did_not_find_any_results应用逻辑中使用稳定的error_service_did_not_find_any_results代码;localMessage包含上述翻译.
error_service_not_implemented应用逻辑中使用稳定的error_service_not_implemented代码;localMessage包含上述翻译.
error_subscription_expired应用逻辑中使用稳定的error_subscription_expired代码;localMessage包含上述翻译.
error_token_expired_or_revoked应用逻辑中使用稳定的error_token_expired_or_revoked代码;localMessage包含上述翻译.
/api/param/find使用 GET /api/param/find.的参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
nationalCatalogId |
integer · int64 | 否 | 标签:国家目录 |
wildberriesTypeId |
integer · int64 | 否 | 野生类型的身份证. |
wildberriesCategoryId |
integer · int64 | 否 | 野生类别的身份. |
ozonCategoryId |
integer · int64 | 否 | 臭氧类别的ID. |
ozonDescriptionCategoryId |
integer · int64 | 否 | 臭氧描述类别ID. |
aliexpressCategoryId |
integer · int64 | 否 | 标签: 标识: |
lamodaCategoryId |
integer · int64 | 否 | 拉莫达类别的身份证. |
kaspiCategoryId |
string | 否 | 卡斯皮类别的身份证. |
avitoCategoryId |
integer · int64 | 否 | 果类别的身份 |
yandexMarketCategoryId |
integer · int64 | 否 | 亚兰德克斯市场类别身份证 |
categoryId |
integer · int32 | 否 | 类别的ID. |
useAllCategories |
boolean | 否 | 使用所有类别. |
useCategoryOption |
boolean | 否 | 使用类别选项. |
limit |
integer · int32 | 否 | 限制. |
page |
integer · int32 | 否 | 页面. |
count |
boolean | 否 | 伯爵. |
sortBy |
string | 否 | 排序了. |
ascending |
boolean | 否 | 升高. |
curl --request GET 'https://api.selsup.ru/api/param/find?limit=50&page=1' \
--header 'Authorization: YOUR_API_TOKEN'
const response = await fetch('https://api.selsup.ru/api/param/find?limit=50&page=1', {
method: 'GET',
headers: { Authorization: process.env.SELSUP_API_TOKEN },
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'selsup_request_failed');
}
const result = await response.json();
const response: Response = await fetch('https://api.selsup.ru/api/param/find?limit=50&page=1', {
method: 'GET',
headers: { Authorization: process.env.SELSUP_API_TOKEN! },
});
if (!response.ok) {
const error = await response.json() as { error?: string };
throw new Error(error.error ?? 'selsup_request_failed');
}
const result: unknown = await response.json();
import os
import requests
response = requests.get(
'https://api.selsup.ru/api/param/find?limit=50&page=1',
headers={'Authorization': os.environ['SELSUP_API_TOKEN']},
)
response.raise_for_status()
result = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.selsup.ru/api/param/find?limit=50&page=1',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: ' . getenv('SELSUP_API_TOKEN')],
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($response === false || $status >= 400) {
throw new RuntimeException($response ?: 'selsup_request_failed');
}
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.selsup.ru/api/param/find?limit=50&page=1", nil)
if err != nil { panic(err) }
req.Header.Set("Authorization", os.Getenv("SELSUP_API_TOKEN"))
response, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer response.Body.Close()
result, _ := io.ReadAll(response.Body)
fmt.Printf("%d\n%s\n", response.StatusCode, result)
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SelSupExample {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.selsup.ru/api/param/find?limit=50&page=1"))
.header("Authorization", System.getenv("SELSUP_API_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
Param[]
| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | 否 | 姓名. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title |
string | 否 | 标题 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
published |
boolean | 否 | 发表了. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
visible |
boolean | 否 | 显而易见. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
serviceParam |
stringNAME, MODEL_NAME, MAIN_IMAGE_URL, TNVED, RICH_CONTENT, DESCRIPTION, TNVED_GROUP, MATERIALS, GENDER, IMAGES, BRAND, PACK_WEIGHT_GR, PACK_WEIGHT_KG, MADE_IN_COUNTRY, MARKING, WILDBERRIES_ARTICLE, WILDBERRIES_COLOR, WILDBERRIES_SIZE, REAL_SIZE, PACK_WIDTH, PACK_HEIGHT, PACK_DEPTH, PACK_LENGTH, MANUFACTURER, MEASURES, DOCUMENT_LINK, DOCUMENT_NAME, KEYWORDS, SEASON, ARTICLE, COLOR, SIZE, MATERIALS_WB, LAUNDRY | 否 | 服务部. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
service |
stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC | 否 | 服务. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useCategoryOption |
boolean | 否 | 使用类别选项. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
valueType |
stringBOOLEAN, LONG, DOUBLE, ENUM, TEXT, DATE | 否 | 值类型 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
displayType |
stringSELECT, SUGGEST, TEXT, CHECKBOX, LONGTEXT | 否 | 显示类型. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
required |
boolean | 否 | 需要. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
multiValueAllowed |
boolean | 否 | 允许多值. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maxValuesCount |
integer · int32 | 否 | 极值值计算. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useDictionary |
boolean | 否 | 使用字典. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description |
string | 否 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupName |
string | 否 | 组名 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groupId |
string | 否 | 组身份证. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ozonDictionaryId |
integer · int64 | 否 | 子词典ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dictionaryId |
integer · int64 | 否 | 字典名单 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measureId |
integer · int32 | 否 | 测量ID. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
measure |
Measure | 否 | 测量. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
对象场
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
integer · int32 | 否 | Id. | ||||||||||||||||
name |
string | 否 | 姓名. | ||||||||||||||||
nationalCatalogId |
integer · int64 | 否 | 标签:国家目录 | ||||||||||||||||
wildberriesTypeId |
integer · int64 | 否 | 野生类型的身份证. | ||||||||||||||||
aliexpressCategoryId |
integer · int64 | 否 | 标签: 标识: | ||||||||||||||||
units |
Unit[] | 否 | 单位. | ||||||||||||||||
阵列项结构
|
|||||||||||||||||||
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
unitsMapmeasureIddefaultUnitUnit
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
name |
string | 否 | 姓名. |
measureId |
integer · int32 | 否 | 测量ID. |
id |
integer · int32 | 否 | Id. |
ozonIdwildberriesIdymIdlamodaIdnationalCatalogIdcategoryIdavitoIdsavitoOptionsXmlFileNameclientIdcreatedDatealiexpressIdpresetdictionaryParamIddictionaryKeylevelgs1ClassuseAllCategoriesoneCIdoptionsOption
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
id |
integer · int64 | 否 | Id. |
name |
string | 否 | 姓名. |
paramId |
integer · int64 | 否 | 位名单. |
ozonId |
integer · int64 | 否 | 气标识. |
wildberriesId |
integer · int64 | 否 | 果的身份证. |
ymId |
integer · int64 | 否 | 您的身份. |
aliexpressId |
integer · int64 | 否 | 快递证件 |
clientId |
integer · int64 | 否 | 客户身份证. |
deleted |
boolean | 否 | 删除了. |
oneCId |
string | 否 | 一个公告. |
dictionary |
boolean | 否 | 字典. |
optionId |
Option | 否 | 选择ID. |
optionsCachelastRefreshOptionsoptionsCountisAnalyticanalyticOrdermarketplaceServiceid[
"string"
]应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
/api/param/{paramId}使用 DELETE /api/param/{paramId}.删除 Param
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
paramId |
integer · int64 | 是 | 位名单. |
curl --request DELETE 'https://api.selsup.ru/api/param/1001' \
--header 'Authorization: YOUR_API_TOKEN'
const response = await fetch('https://api.selsup.ru/api/param/1001', {
method: 'DELETE',
headers: { Authorization: process.env.SELSUP_API_TOKEN },
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'selsup_request_failed');
}
const result = await response.json();
const response: Response = await fetch('https://api.selsup.ru/api/param/1001', {
method: 'DELETE',
headers: { Authorization: process.env.SELSUP_API_TOKEN! },
});
if (!response.ok) {
const error = await response.json() as { error?: string };
throw new Error(error.error ?? 'selsup_request_failed');
}
const result: unknown = await response.json();
import os
import requests
response = requests.delete(
'https://api.selsup.ru/api/param/1001',
headers={'Authorization': os.environ['SELSUP_API_TOKEN']},
)
response.raise_for_status()
result = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.selsup.ru/api/param/1001',
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: ' . getenv('SELSUP_API_TOKEN')],
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($response === false || $status >= 400) {
throw new RuntimeException($response ?: 'selsup_request_failed');
}
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.selsup.ru/api/param/1001", nil)
if err != nil { panic(err) }
req.Header.Set("Authorization", os.Getenv("SELSUP_API_TOKEN"))
response, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer response.Body.Close()
result, _ := io.ReadAll(response.Body)
fmt.Printf("%d\n%s\n", response.StatusCode, result)
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SelSupExample {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.selsup.ru/api/param/1001"))
.header("Authorization", System.getenv("SELSUP_API_TOKEN"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
"string"应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
error_no_client应用逻辑中使用稳定的error_no_client代码;localMessage包含上述翻译.
error_remove_param应用逻辑中使用稳定的error_remove_param代码;localMessage包含上述翻译.
error_subscription_expired应用逻辑中使用稳定的error_subscription_expired代码;localMessage包含上述翻译.