Repository User List Resource¶
Provides information on users who are allowed access to a repository.
- Version Added:
4.0.11
Details¶
Name | repository_users |
URI | /api/repositories/{repository_id}/users/ |
Token Policy ID | repository_user |
HTTP Methods | |
Parent Resource | |
Child Resources |
Links¶
Name |
Method |
Resource |
---|---|---|
create | POST |
|
self | GET |
HTTP GET¶
Retrieves the list of users belonging to a specific review group.
This includes only the users who have active accounts on the site. Any account that has been disabled (for inactivity, spam reasons, or anything else) will be excluded from the list.
The list of users can be filtered down using the q
and
fullname
parameters.
Setting q
to a value will by default limit the results to
usernames starting with that value. This is a case-insensitive
comparison.
If fullname
is set to 1
, the first and last names will also be
checked along with the username. fullname
is ignored if q
is not set.
For example, accessing /api/users/?q=bo&fullname=1
will list
any users with a username, first name or last name starting with
bo
.
Request Parameters¶
counts-onlyBoolean | If specified, a single |
fullnameBoolean | Specifies whether |
include-inactiveBoolean | If set, users who are marked as inactive (their accounts have been disabled) will be included in the list. |
max-resultsInteger | The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link. |
qString | The string that the username (or the first name or last name when using |
render-avatars-atString | A comma-separated list of avatar pixel sizes to render. Renders for each specified size be available in the |
startInteger | The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
226 - User Query ErrorHTTP 500 - Internal Server Error | An error occurred querying the user list. |
HTTP POST¶
Adds a user to the repository ACL.
Request Parameters¶
usernameString | Required The user to add to the repository ACL. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
208 - Invalid UserHTTP 400 - Bad Request | User does not exist. |
Examples¶
application/vnd.reviewboard.org.repository-users+json¶
$ curl https://reviews.example.com/api/repositories/1/users/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 1797
Content-Type: application/vnd.reviewboard.org.repository-users+json
ETag: 85df32a984918d234dc273aaf11f775e0efe58a7
Item-Content-Type: application/vnd.reviewboard.org.repository-user+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"links": {
"create": {
"href": "https://reviews.example.com/api/repositories/1/users/",
"method": "POST"
},
"self": {
"href": "https://reviews.example.com/api/repositories/1/users/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 2,
"users": [
{
"avatar_html": null,
"avatar_url": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=48&d=mm",
"avatar_urls": {
"1x": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=48&d=mm",
"2x": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=96&d=mm",
"3x": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=144&d=mm"
},
"email": "doc@example.com",
"first_name": "Doc",
"fullname": "Doc Dwarf",
"id": 2,
"is_active": true,
"last_name": "Dwarf",
"links": {
"delete": {
"href": "https://reviews.example.com/api/repositories/1/users/doc/",
"method": "DELETE"
},
"self": {
"href": "https://reviews.example.com/api/repositories/1/users/doc/",
"method": "GET"
}
},
"url": "/users/doc/",
"username": "doc"
},
{
"avatar_html": null,
"avatar_url": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=48&d=mm",
"avatar_urls": {
"1x": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=48&d=mm",
"2x": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=96&d=mm",
"3x": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=144&d=mm"
},
"email": "dopey@example.com",
"first_name": "Dopey",
"fullname": "Dopey Dwarf",
"id": 3,
"is_active": true,
"last_name": "Dwarf",
"links": {
"delete": {
"href": "https://reviews.example.com/api/repositories/1/users/dopey/",
"method": "DELETE"
},
"self": {
"href": "https://reviews.example.com/api/repositories/1/users/dopey/",
"method": "GET"
}
},
"url": "/users/dopey/",
"username": "dopey"
}
]
}