logo
开发者文档
搜索
更新 Tool

更新 Tool

支持更新指定组织下 Tool 的基础信息、接口定义和鉴权信息。

可以通过该接口,更新指定组织下的 Tool 基础信息、接口定义和鉴权信息。

请求方式

PUT

调用地址

https://api.${endpoint}/v1/org/tool/update

调用验证

使用账号级 DevKey / DevSecret 的 Basic 鉴权,并要求调用账号具备组织 Tool 管理权限。

请求

请求示例

curl -X PUT 'https://api.${endpoint}/v1/org/tool/update' \ -H 'Authorization: Basic ${BASIC_TOKEN}' \ -H 'Content-Type: application/json' \ -d '{ "org_id": "p-xxxx", "tool_id": "tool-xxxx", "name": "weather", "display_name": "Weather Lookup", "description": "Query current weather", "logo": "https://cdn.example.com/weather.png", "url": "https://api.example.com", "show_request": true, "api_schema": "{\"openapi\":\"3.0.0\",\"paths\":{}}", "auth_provider": "Creator", "auth_type": "Bearer", "auth_key": "token" }'
                      
                      curl -X PUT 'https://api.${endpoint}/v1/org/tool/update' \
  -H 'Authorization: Basic ${BASIC_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{
    "org_id": "p-xxxx",
    "tool_id": "tool-xxxx",
    "name": "weather",
    "display_name": "Weather Lookup",
    "description": "Query current weather",
    "logo": "https://cdn.example.com/weather.png",
    "url": "https://api.example.com",
    "show_request": true,
    "api_schema": "{\"openapi\":\"3.0.0\",\"paths\":{}}",
    "auth_provider": "Creator",
    "auth_type": "Bearer",
    "auth_key": "token"
  }'

                    
此代码块在浮窗中显示

请求头

字段 类型 说明
Authorization Basic ${BASIC_TOKEN} 使用 DevKey:DevSecret Base64 后的 Basic Token。
Content-Type application/json 请求体格式。

请求参数(Body Parameters)

参数 类型 说明 required
org_id String 组织 ID。 true
tool_id String Tool ID。 true
name String Tool 名称,最多 20 个字符。 true
display_name String Tool 展示名称,最多 50 个字符。 false
description String Tool 描述,最多 100 个字符。 true
logo String Tool 图标 URL。 true
url String Tool 基础 URL,必须为公网 http/https 地址。 true
show_request Boolean 是否在调用过程里展示请求内容。 true
api_schema String OpenAPI JSON Schema。不传时不更新接口定义。 false
auth_provider String 鉴权提供方。不传时不更新鉴权配置。 false
auth_type String 鉴权类型。 false
auth_key String 鉴权 key 或 token。 false
auth_key_name String 鉴权 key 展示名称。 false
auth_key_tip String 鉴权 key 提示。 false
auth_secret String 鉴权 secret。 false
auth_secret_name String 鉴权 secret 展示名称。 false
auth_secret_tip String 鉴权 secret 提示。 false

响应

响应示例

{ "code": 0, "message": "OK", "affect_count": 1 }
                      
                      {
  "code": 0,
  "message": "OK",
  "affect_count": 1
}

                    
此代码块在浮窗中显示

成功响应

字段 类型 说明
affect_count Integer 影响记录数。

失败响应

字段 类型 说明
code Integer 错误码。
message String 错误详情。

状态码

状态码 说明
200 成功
400 参数错误
401 未授权
403 权限不足
429 请求过于频繁
500 服务器错误