Notification settings API
Notification settings API
在 GitLab 8.12 中 .
通知级别在模型枚举中定义. 当前,这些级别被认可:
如果使用custom
级别,则可以控制特定的电子邮件事件. 可用事件由NotificationSetting.email_events
返回. 当前,这些事件被认可:
new_note
reopen_issue
close_issue
reassign_issue
issue_due
new_merge_request
push_to_merge_request
reopen_merge_request
close_merge_request
reassign_merge_request
merge_merge_request
failed_pipeline
fixed_pipeline
new_epic
GET /notification_settings
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/notification_settings"
响应示例:
{ "level": "participating", "notification_email": "admin@example.com" }
更新当前的通知设置和电子邮件地址.
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/notification_settings?level=watch"
响应示例:
{ "level": "watch", "notification_email": "admin@example.com" }
GET /groups/:id/notification_settings
GET /projects/:id/notification_settings
响应示例:
{ "level": "global" }
更新当前的组/项目通知设置.
PUT /projects/:id/notification_settings
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/notification_settings?level=watch"
响应示例: