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
  1. GET /notification_settings
  1. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/notification_settings"

响应示例:

  1. { "level": "participating", "notification_email": "admin@example.com" }

更新当前的通知设置和电子邮件地址.

  1. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/notification_settings?level=watch"

响应示例:

  1. { "level": "watch", "notification_email": "admin@example.com" }
  1. GET /groups/:id/notification_settings
  2. GET /projects/:id/notification_settings

响应示例:

  1. { "level": "global" }

更新当前的组/项目通知设置.

  1. PUT /projects/:id/notification_settings
  1. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/notification_settings?level=watch"

响应示例: