This resource represents Users that are assigned for Code Reviews. Assignees are responsible for marking a Code Review as approved. Any User with at least read access to a repository can be an Assignee with one exception: if a Code Review is requested for a branch for which there are branch restrictions set up, every Assignee must have write permissions to the repository then.
We are gradually phasing out XML support from our API and this is one of the first resources that are provided only in JSON format. The format was also a bit adjusted compared to other resources: associated objects (like repositories and users) are now embedded into JSON itself, and there are no JSON root elements anymore.
id | integer | User ID. |
---|---|---|
name | string | User name. |
login | string | User login. |
string | User email address. | |
assigned_at | datetime | Date and time when the User was assigned to the Code Review. |
approved_at | datetime | Date and time when the User has approved the Code Review. |
This method returns an array of Assignees of a specified Code Review.
GET /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/assignees.json
Click to expand…
json http-response[
{
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com",
"assigned_at": "2014/12/31 09:30:15 -0500",
"approved_at": null
}
]
Only users that have access to the repository can be assigned to a Code Review from that repository.
POST /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/assignees.json
{
"assignee_id": 1
}
Click to expand…
json http-responseSTATUS: 200
[
{
"id": 1,
"name": "Ilya Sabanin",
"login": "ilya",
"email": "ilya@example.com",
"assigned_at": "2014/12/31 09:31:36 -0500",
"approved_at": null
}
]
By removing a User from assignees you are revoking this User’s ability to approve the review.
DELETE /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/assignees/{USER_ID}.json
Click to expand…
json http-responseHEAD 200 OK