跳到主要内容

Note Event

Note事件参数说明

请求头

参数名称类型参数说明
User-Agentstring
Content-Typestring
X-GitCode-Eventstring事件类型,Note Hook代表评论事件
X-GitCode-Deliverystring请求唯一id

请求参数

参数名称参数类型参数说明
object_kindstring事件类型,此处为 "note"
event_typestring事件类型,此处为 "note"
user.idinteger评论用户ID
user.namestring评论用户名称
user.usernamestring评论用户登录名
user.avatar_urlstring评论用户头像URL
user.emailstring评论用户邮箱
project_idinteger项目ID
project.idinteger项目ID
project.namestring项目名称
project.web_urlstring项目Web访问地址
project.avatar_urlstring项目头像URL
project.git_ssh_urlstring项目SSH克隆地址
project.git_http_urlstring项目HTTP克隆地址
project.namespacestring项目命名空间
project.visibility_levelinteger项目可见性级别(0: 私有, 1:公开)
project.path_with_namespacestring带命名空间的项目路径
project.default_branchstring默认分支
project.homepagestring项目主页
project.urlstring项目Git仓库URL
project.ssh_urlstring项目SSH克隆URL
project.http_urlstring项目HTTP克隆URL
object_attributes.author_idinteger评论作者ID
object_attributes.change_positionobject变更位置信息
object_attributes.created_atstring评论创建时间
object_attributes.discussion_idstring讨论ID
object_attributes.idinteger评论ID
object_attributes.notestring评论内容
object_attributes.noteable_idinteger被评论对象ID
object_attributes.noteable_typestring被评论对象类型(Issue/MergeRequest/Commit)
object_attributes.original_positionobject原始位置信息
object_attributes.positionobject位置信息
object_attributes.project_idinteger项目ID
object_attributes.systemboolean是否为系统评论
object_attributes.typestring评论类型
object_attributes.updated_atstring评论更新时间
object_attributes.descriptionstring评论描述
object_attributes.urlstring评论URL
repository.namestring仓库名称
repository.urlstring仓库Git URL
repository.homepagestring仓库主页
repository.git_http_urlstring仓库HTTP克隆地址
repository.git_ssh_urlstring仓库SSH克隆地址
repository.visibility_levelinteger仓库可见性级别(0: 私有, 1:公开)
issueobjectissue详细信息,评论对象是issue是出现
merge_requestobjectmerge_request详细信息,评论对象是MergeRequest是出现
comitobjectcommit详细信息,评论对象是commit是出现
produce_random_idstring随机生成的ID
manual_buildboolean
uuidstring事件唯一标识符

请求参数示例

{
"object_kind": "note",
"event_type": "note",
"user": {
"id": 173794,
"name": "xiaogang_o",
"username": "xiaogang_o",
"avatar_url": "https://cdn-img.gitcode.com/ee/ca/756863eec250a6a067148d4d4fe71d28c3b9716a6f79c03a9f460543fa3dc838.jpg?time=1711433667506",
"email": "xiaogang@csdn.net"
},
"project_id": 1848674,
"project": {
"id": 1848674,
"name": "test",
"web_url": "https://gitcode.com/xiaogang_o/test",
"avatar_url": "https://cdn-img.gitcode.com/ee/ca/756863eec250a6a067148d4d4fe71d28c3b9716a6f79c03a9f460543fa3dc838.jpg?time=1711433667506",
"git_ssh_url": "git@gitcode.com:xiaogang_o/test.git",
"git_http_url": "https://gitcode.com/xiaogang_o/test.git",
"namespace": "xiaogang_o",
"visibility_level": 0,
"path_with_namespace": "xiaogang_o/test",
"default_branch": "main",
"homepage": "https://gitcode.com/xiaogang_o/test",
"url": "git@gitcode.com:xiaogang_o/test.git",
"ssh_url": "git@gitcode.com:xiaogang_o/test.git",
"http_url": "https://gitcode.com/xiaogang_o/test.git"
},
"object_attributes": {
"author_id": 173794,
"change_position": {},
"created_at": "2025-05-07T15:09:04+08:00",
"discussion_id": "f88d5fc2e14fc2a55efebff4a0e2e9b6a8a3c27f",
"id": 96281182,
"note": "评论",
"noteable_id": 3084068,
"noteable_type": "Issue",
"original_position": {},
"position": {},
"project_id": 1848674,
"system": false,
"type": "DiscussionNote",
"updated_at": "2025-05-07T15:09:04+08:00",
"description": "评论",
"url": "https://gitcode.com/xiaogang_o/test/issues/8#note_f88d5fc2e14fc2a55efebff4a0e2e9b6a8a3c27f"
},
"repository": {
"name": "test",
"url": "git@gitcode.com:xiaogang_o/test.git",
"homepage": "https://gitcode.com/xiaogang_o/test",
"git_http_url": "https://gitcode.com/xiaogang_o/test.git",
"git_ssh_url": "git@gitcode.com:xiaogang_o/test.git",
"visibility_level": 0
},
"issue": {
"author_id": 173794,
"author": {
"avatar_url": "https://cdn-img.gitcode.com/ee/ca/756863eec250a6a067148d4d4fe71d28c3b9716a6f79c03a9f460543fa3dc838.jpg?time=1711433667506",
"web_url": "https://gitcode.com/xiaogang_o",
"name": "xiaogang_o",
"id": 173794,
"email": "xiaogang@csdn.net",
"username": "xiaogang_o"
},
"confidential": false,
"created_at": "2025-05-07T14:19:24+08:00",
"description": "内容",
"id": 3084068,
"iid": 8,
"project_id": 1848674,
"relative_position": 1073745823,
"state": "opened",
"title": "测试issue",
"updated_at": "2025-05-07T15:09:04+08:00",
"url": "https://gitcode.com/xiaogang_o/test/issues/8",
"total_time_spent": 0,
"assignee_ids": []
},
"produce_random_id": "cbb9c209-2e64-4d9c-98e5-ba0f08cd9b20",
"manual_build": false,
"uuid": "5b8f08e9-a74c-44ac-beaf-7680e9862165"
}