- 文档专区
- 石墨API 接口
- 接入方实现接口(回调接口)
- 文件信息
- 用户信息
- 团队和部门
- 搜索功能
- 消息推送
- 评论
- 讨论(Discussion)
- 提及(MentionAt @ 人)
- 日期提醒 (DateMention)
- 文件内容更新 (FileContent)
- 文档协作者协同状态变化 (Collaborator)
- 版本 (Revision)
- 系统事件 (System)
- (实验性) 回调请求错误
- 评论
添加评论
开发中
POST
{endpoint_url}/events
请求参数
Path 参数
endpoint_url
string
必需
示例值:
{{endpoint_url}}
Header 参数
X-Shimo-Token
string
必需
X-Shimo-Sdk-Event
string
必需
示例值:
Comment
Body 参数application/json
kind
string
必需
type
string
必需
action
string
业务操作
fileId
string
接入方文件 ID
userId
string
接入方用户 ID
comment
object
必需
guid
string
评论 ID
content
string
评论内容
userIds
array[string]
必需
selectionGuid
string
必需
selectionContent
string
必需
示例
{
"kind": "comment",
"type": "comment", // 预留评论下的小分类,目前就 comment
"action": "create", // 业务操作
"fileId": "file1", // 接入方文件 ID
"userId": "user1", // 接入方用户 ID
"comment": {
"guid": "wS2uTQBMuujrwaGZ", // 评论 ID
"content": "这是评论内容", // 评论内容
"userIds": ["user1", "user2"], // 评论中若有 at 用户,此参数会传递一份,也可通过 mention_at 事件中获取
"selectionGuid": "comment-Ynimup3kBXoxwF4j", // 评论划词高亮区域的 ID
"selectionContent": "123123123123"
}
}
示例代码
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-Token;' \
--header 'X-Shimo-Sdk-Event: Comment' \
--header 'Content-Type: application/json' \
--data-raw '{
"kind": "comment",
"type": "comment", // 预留评论下的小分类,目前就 comment
"action": "create", // 业务操作
"fileId": "file1", // 接入方文件 ID
"userId": "user1", // 接入方用户 ID
"comment": {
"guid": "wS2uTQBMuujrwaGZ", // 评论 ID
"content": "这是评论内容", // 评论内容
"userIds": ["user1", "user2"], // 评论中若有 at 用户,此参数会传递一份,也可通过 mention_at 事件中获取
"selectionGuid": "comment-Ynimup3kBXoxwF4j", // 评论划词高亮区域的 ID
"selectionContent": "123123123123"
}
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2024-03-19 08:39:26