Beanstalk

Code Review Assignee Resource

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.

New format

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.

Attributes

id integer User ID.
name string User name.
login string User login.
email 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.

Find All Code Review Assignees

This method returns an array of Assignees of a specified Code Review.

json http-request
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
  }
]

Assign User to Code Review

Only users that have access to the repository can be assigned to a Code Review from that repository.

json http-request
POST /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/assignees.json

{
  "assignee_id": 1
}

Click to expand…

json http-response
STATUS: 200

[
  {
    "id": 1,
    "name": "Ilya Sabanin",
    "login": "ilya",
    "email": "ilya@example.com",
    "assigned_at": "2014/12/31 09:31:36 -0500",
    "approved_at": null
  }
]

Remove User From Code Review Assignees

By removing a User from assignees you are revoking this User’s ability to approve the review.

json http-request
DELETE /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/assignees/{USER_ID}.json

Click to expand…

json http-response
HEAD 200 OK