通过可编辑的独立合同来支持本页面. 在生产使用之前,验证使用测试数据的写作操作.
/api/property
准备使用的工作流程
准备使用的工作流程
数据模型
数据结构
模型在此列出一次,并且可以直接从使用它们的终端点扩展.
Property6 字段
organizationIdinteger · int64组织身份证.
clientIdinteger · int64客户身份证.
read-onlycomponentstring组件.
namestring姓名.
valuestring价值.
valueNamestring值名字
错误合同
如何返回应用错误
编程的代码在每个地方都相同,而用户面向的消息由服务器翻译. 建立在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/property/使用 PUT /api/property/. 设置物业
要求机构
application/json对象场Property
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
organizationId |
integer · int64 | 否 | 组织身份证. |
clientId |
integer · int64 | 否 | 客户身份证. |
component |
string | 否 | 组件. |
name |
string | 否 | 姓名. |
value |
string | 否 | 价值. |
valueName |
string | 否 | 值名字 |
curl --request PUT 'https://api.selsup.ru/api/property/' \
--header 'Authorization: YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"organizationId": 1001,
"clientId": 1001,
"component": "string",
"name": "Example",
"value": "string",
"valueName": "Example"
}'
const response = await fetch('https://api.selsup.ru/api/property/', {
method: 'PUT',
headers: {
Authorization: process.env.SELSUP_API_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organizationId": 1001,
"clientId": 1001,
"component": "string",
"name": "Example",
"value": "string",
"valueName": "Example"
}),
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'selsup_request_failed');
}
const response: Response = await fetch('https://api.selsup.ru/api/property/', {
method: 'PUT',
headers: {
Authorization: process.env.SELSUP_API_TOKEN!,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organizationId": 1001,
"clientId": 1001,
"component": "string",
"name": "Example",
"value": "string",
"valueName": "Example"
}),
});
if (!response.ok) {
const error = await response.json() as { error?: string };
throw new Error(error.error ?? 'selsup_request_failed');
}
import os
import requests
response = requests.put(
'https://api.selsup.ru/api/property/',
headers={'Authorization': os.environ['SELSUP_API_TOKEN']},
json={
'organizationId': 1001,
'clientId': 1001,
'component': 'string',
'name': 'Example',
'value': 'string',
'valueName': 'Example'
},
)
response.raise_for_status()
<?php
$payload = <<<'JSON'
{
"organizationId": 1001,
"clientId": 1001,
"component": "string",
"name": "Example",
"value": "string",
"valueName": "Example"
}
JSON;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.selsup.ru/api/property/',
CURLOPT_CUSTOMREQUEST => 'PUT',
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("PUT", "https://api.selsup.ru/api/property/", strings.NewReader(`{
"organizationId": 1001,
"clientId": 1001,
"component": "string",
"name": "Example",
"value": "string",
"valueName": "Example"
}`))
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/property/"))
.header("Authorization", System.getenv("SELSUP_API_TOKEN"))
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("""
{
"organizationId": 1001,
"clientId": 1001,
"component": "string",
"name": "Example",
"value": "string",
"valueName": "Example"
}
"""))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
成功的反应
200答案没有身体.
错误5
应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
error_invalid_currency_source应用逻辑中使用稳定的error_invalid_currency_source代码;localMessage包含上述翻译.
error_no_client应用逻辑中使用稳定的error_no_client代码;localMessage包含上述翻译.
走吧
/api/property/{organizationId}/{component}开始使用GET/api/property/{organizationId}/{component}.
路径参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
organizationId |
integer · int64 | 是 | 组织身份证. |
component |
string | 是 | 组件. |
curl --request GET 'https://api.selsup.ru/api/property/1001/string' \
--header 'Authorization: YOUR_API_TOKEN'
const response = await fetch('https://api.selsup.ru/api/property/1001/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/property/1001/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/property/1001/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/property/1001/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/property/1001/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/property/1001/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());
}
}
成功的反应
200"string"错误7
应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
error_header_logo_upload_failed应用逻辑中使用稳定的error_header_logo_upload_failed代码;localMessage包含上述翻译.
error_no_client应用逻辑中使用稳定的error_no_client代码;localMessage包含上述翻译.
error_ozon_fbo_workflow_not_found应用逻辑中使用稳定的error_ozon_fbo_workflow_not_found代码;localMessage包含上述翻译.
error_user_does_not_have_this_organization应用逻辑中使用稳定的error_user_does_not_have_this_organization代码;localMessage包含上述翻译.
列表
/api/property/list/{component}使用 GET /api/property/list/{component}.的列表
路径参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
component |
string | 是 | 组件. |
查询参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
organizationId |
integer · int64 | 否 | 组织身份证. |
curl --request GET 'https://api.selsup.ru/api/property/list/string' \
--header 'Authorization: YOUR_API_TOKEN'
const response = await fetch('https://api.selsup.ru/api/property/list/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/property/list/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/property/list/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/property/list/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/property/list/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/property/list/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());
}
}
成功的反应
200
阵列项结构
Property[]
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
organizationId |
integer · int64 | 否 | 组织身份证. |
clientId |
integer · int64 | 否 | 客户身份证. |
component |
string | 否 | 组件. |
name |
string | 否 | 姓名. |
value |
string | 否 | 价值. |
valueName |
string | 否 | 值名字 |
[
"string"
]错误4
应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑
auth_requiredAuthorization 缺失,空,或包含无效的代币.
error_access_denied代币存在,但它的作用不能执行这个操作.
error_unknown节省请求时间和联系支持;不要盲目重新尝试突变.
error_subscription_expired应用逻辑中使用稳定的error_subscription_expired代码;localMessage包含上述翻译.