Skip to content

转发调料

本文档介绍转发规则(烘焙配方)相关的 API 接口。

获取转发规则

获取当前用户的转发规则配置。

接口

http
POST /forward/get

请求头

http
Content-Type: application/json

请求体

json
{
  "token": "YOUR_TOKEN",
  "clientId": "client_id",
  "clientPwd": "client_password"
}

请求参数

字段类型必填说明
tokenstring访问 Token
clientIdstring工坊 ID(仅在编辑工坊行为调料时填写)
clientPwdstring工坊密钥(可选)

响应

json
{
  "success": true,
  "msg": "success",
  "forwardData": {
    "autoUpload": {
      "enable": true,
      "value": "true"
    },
    "hideProfile": {
      "enable": false,
      "value": "false"
    }
  }
}

响应参数

字段类型说明
successboolean是否成功
msgstring消息说明
forwardDataobject转发规则数据,键为规则名,值为包含 enable 和 value 的对象

示例

bash
curl -X POST https://api.xn--igrr70arr3c.vip/zundalink/api/v0/forward/get \
  -H "Content-Type: application/json" \
  -d '{
    "token": "YOUR_TOKEN"
  }'

添加/更新转发规则

添加或更新转发规则配置。

接口

http
POST /forward/add

请求头

http
Content-Type: application/json

请求体

json
{
  "token": "YOUR_TOKEN",
  "rule": "autoUpload",
  "enable": true,
  "value": "true",
  "clientId": "client_id",
  "clientPwd": "client_password"
}

请求参数

字段类型必填说明
tokenstring访问 Token
rulestring规则名称
enableboolean是否启用
valuestring规则值
clientIdstring工坊 ID(仅在编辑工坊行为调料时填写)
clientPwdstring工坊密钥(可选)

响应

json
{
  "success": true,
  "msg": "success"
}

示例

bash
curl -X POST https://api.xn--igrr70arr3c.vip/zundalink/api/v0/forward/add \
  -H "Content-Type: application/json" \
  -d '{
    "token": "YOUR_TOKEN",
    "rule": "autoUpload",
    "enable": true,
    "value": "true"
  }'

删除转发规则

删除转发规则配置。

接口

http
POST /forward/del

请求头

http
Content-Type: application/json

请求体

json
{
  "token": "YOUR_TOKEN",
  "clientId": "client_id",
  "clientPwd": "client_password"
}

请求参数

字段类型必填说明
tokenstring访问 Token
clientIdstring工坊 ID(仅在编辑工坊行为调料时填写)
clientPwdstring工坊密钥(可选)

响应

json
{
  "success": true,
  "msg": "success",
  "forwardData": {}
}

示例

bash
curl -X POST https://api.xn--igrr70arr3c.vip/zundalink/api/v0/forward/del \
  -H "Content-Type: application/json" \
  -d '{
    "token": "YOUR_TOKEN"
  }'

Released under the CC BY-NC-SA 4.0 License.