- 文档专区
- 石墨API 接口
- 接入方实现接口(回调接口)
- 文件信息
- 用户信息
- 团队和部门
- 搜索功能
- 消息推送
- 评论
- 讨论(Discussion)
- 提及(MentionAt @ 人)
- 日期提醒 (DateMention)
- 文件内容更新 (FileContent)
- 文档协作者协同状态变化 (Collaborator)
- 版本 (Revision)
- 系统事件 (System)
- ( 实验性) 回调请求错误
- 评论
回调请求错误
开发中
POST
{endpoint_url}/events
请求数据
和 响应数据
以及文档中台错误通过此消息推送至接入方接口,用于及时发现接入方自身回调接口问题。说明
请求参数
Path 参数
endpoint_url
string
必需
示例值:
{{endpoint_url}}
Header 参数
X-Shimo-Credential-Type
string
必需
X-Shimo-Sdk-Event
string
必需
示例值:
Collaborator
X-Shimo-Signature
string
必需
Body 参数application/json
kind
string
必需
type
string
必需
appId
string
必需
timestamp
integer
必需
request
object
必需
headers
object
必需
url
string
必需
body
string
必需
response
object
必需
headers
object
必需
status
integer
必需
body
string
必需
errorMessage
string
必需
示例
{
"kind": "System",
"type": "endpointCallback",
"appId": "your app id",
"timestamp": 1669610727509, // 此事件产生的时间戳,单位毫秒
"request": {
// 错误回调请求的请求数据
"headers": {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Shimo-APP-ID": "your app id",
"X-Shimo-Credential-Type": "0", // 0 代表使用用户 token 发起的回调请求, 3 表示石墨 SDK 主动签名发起的回调请求
"X-Shimo-Token": "your user token",
"X-Shimo-Signature": "the signature generate by sdk"
},
"url": "http://your-callback-api-host/callback/users/current/info",
"body": ""
},
"response": {
// 错误回调请求的响应数据
"headers": {
"Connection": "keep-alive",
"Content-Length": "9",
"Content-Type": "text/plain; charset=utf-8",
"Date": "Mon, 28 Nov 2022 04:45:27 GMT"
},
"status": 404,
"body": "Not Found"
},
"errorMessage": "endpoint: request endpoint server failed with status code 0, code 10009, message: GET request failed (http://your-callback-api-host/callback/users/current/info) with status code: 404 "
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/events' \
--header 'X-Shimo-Credential-Type;' \
--header 'X-Shimo-Sdk-Event: Collaborator' \
--header 'X-Shimo-Signature;' \
--header 'Content-Type: application/json' \
--data-raw '{
"kind": "System",
"type": "endpointCallback",
"appId": "your app id",
"timestamp": 1669610727509, // 此事件产生的时间戳,单位毫秒
"request": {
// 错误回调请求的请求数据
"headers": {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Shimo-APP-ID": "your app id",
"X-Shimo-Credential-Type": "0", // 0 代表使用用户 token 发起的回调请求, 3 表示石墨 SDK 主动签名发起的回调请求
"X-Shimo-Token": "your user token",
"X-Shimo-Signature": "the signature generate by sdk"
},
"url": "http://your-callback-api-host/callback/users/current/info",
"body": ""
},
"response": {
// 错误回调请求的响应数据
"headers": {
"Connection": "keep-alive",
"Content-Length": "9",
"Content-Type": "text/plain; charset=utf-8",
"Date": "Mon, 28 Nov 2022 04:45:27 GMT"
},
"status": 404,
"body": "Not Found"
},
"errorMessage": "endpoint: request endpoint server failed with status code 0, code 10009, message: GET request failed (http://your-callback-api-host/callback/users/current/info) with status code: 404 "
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2024-03-19 08:39:33