Group and project access requests API

Group and project access requests API

注意:此功能是在 GitLab 8.11 中引入的

访问级别在模块中定义. 当前,这些级别被认可:

  • 无法访问( 0
  • 宾客( 10
  • 记者( 20
  • 显影剂( 30
  • 养护者( 40
  • 所有者( 50 )-仅对组有效

获取认证用户可见的访问请求列表.

  1. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests"

响应示例:

  1. [ { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "created_at": "2012-10-22T14:13:35Z", "requested_at": "2012-10-22T14:13:35Z" }, { "id": 2, "username": "john_doe", "name": "John Doe", "state": "active", "created_at": "2012-10-22T14:13:35Z", "requested_at": "2012-10-22T14:13:35Z" } ]

请求已验证用户访问组或项目.

请求示例:

  1. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/access_requests"
  2. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests"
  1. { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "created_at": "2012-10-22T14:13:35Z", "requested_at": "2012-10-22T14:13:35Z" }

批准给定用户的访问请求.

请求示例:

  1. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/access_requests/:user_id/approve?access_level=20"
  2. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests/:user_id/approve?access_level=20"

响应示例:

  1. { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "created_at": "2012-10-22T14:13:35Z", "access_level": 20 }

请求示例:

  1. curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests/:user_id"