# 06-消息
# 1 设置
# 1.1 监听设置(GET)
消息监听,监听设置
# URL
https://developers.cjdropshipping.com/api2.0/v1/webhook/set
# CURL
curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/webhook/set' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"product": {
"type": "ALL",
"callbackUrls": [
"http://localhsost:8080/api2.0/"
]
},
"stock": {
"type": "ALL",
"callbackUrls": [
"http://localhsost:8080/api2.0/"
]
}
}'
参数名称 | 参数意义 | 参数类型 | 是否必传 | 长度 | 备注 |
---|---|---|---|---|---|
product | 商品消息 | object | 是 | 200 | 商品消息设置 |
type | 监听类型 | string | 是 | 200 | ALL-全部,CANCEL-取消 |
callbackUrls | 监听接口 | list | 是 | 5 | 支持多个监听(最大为5) |
stock | 库存消息 | object | 是 | 200 | 库存消息设置 |
type | 监听类型 | string | 是 | 200 | ALL-全部,CANCEL-取消 |
callbackUrls | 监听接口 | list | 是 | 5 | 支持多个监听(最大为5) |
# 返回
success
{
"code": 200,
"result": true,
"message": "Success",
"data": true,
"requestId": "97367e0f-cf3a-4c9b-acea-a36fb56f81b8"
}
返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
---|---|---|---|---|
code | 错误码 | int | 20 | 返回错误码标准表 |
result | 是否正常返回 | boolean | 1 | |
message | 返回信息 | string | 200 | |
data | 是否设置成功 | boolean | 1 | 接口数据返回 |
requestId | 请求Id | string | 48 | 用于日志查询错误 |
error
{
"code": 1601000,
"result": false,
"message": "User not find",
"data": null,
"requestId": "a18c9793-7c99-42f9-970b-790eecdceba2"
}
返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
---|---|---|---|---|
code | 错误码 | int | 20 | 返回错误码标准表 |
result | 是否正常返回 | boolean | 1 | |
message | 返回信息 | string | 200 | |
data | 接口数据返回 | |||
requestId | 请求Id | string | 48 | 用于日志查询错误 |
← 06-纠纷