User Resource¶
Creates and provides information on users.
If a user’s profile is private, the fields email
, first_name
,
last_name
, and fullname
will be omitted for non-staff users.
Details¶
Name | user |
URI | /api/users/{username}/ |
Token Policy ID | user |
HTTP Methods | |
Parent Resource | User List Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Fields¶
avatar_htmlString | HTML for rendering the avatar at specified sizes. This is only populated if using Added in 3.0.14 |
avatar_urlString | Deprecated The URL for an avatar representing the user, if available. Added in 1.6.14 Deprecated in 3.0 |
avatar_urlsString | The URLs for an avatar representing the user, if available. Added in 3.0 |
emailString | The user’s e-mail address |
first_nameString | The user’s first name. |
fullnameString | The user’s full name (first and last). |
idInteger | The numeric ID of the user. |
is_activeBoolean | Whether or not the user is active. Inactive usersare not able to log in or make changes to Review Board. Added in 2.5.9 |
last_nameString | The user’s last name. |
urlString | The URL to the user’s page on the site. This is deprecated and will be removed in a future version. |
usernameString | The user’s username. |
Links¶
Name | Method | Resource |
---|---|---|
api_tokens | GET | API Token List Resource |
archived_review_requests | GET | Archived Review Request List Resource |
muted_review_requests | GET | Muted Review Request List Resource |
self | GET | User Resource |
update | PUT | User Resource |
user_file_attachments | GET | User File Attachment List Resource |
watched | GET | Watched List Resource |
HTTP GET¶
Retrieve information on a registered user.
This mainly returns some basic information (username, full name, e-mail address) and links to that user’s root Watched Items resource, which is used for keeping track of the groups and review requests that the user has “starred”.
Request Parameters¶
render-avatars-atString | A comma-separated list of avatar pixel sizes to render. Renders for each specified size be available in the avatars_html dictionary. If not provided, avatars will not be rendered. |
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. |
HTTP PUT¶
Update information on a user.
Users can update their own email
, first_name
, and last_name
information.
Administrators or those with the auth.change_user
permission can
update those along with is_active
. When setting is_active
to
False
, the user will not be able to log in through standard
credentials or API tokens. (Note that this does not delete their
password or API tokens. It simply blocks the ability to log in.)
Note
This API cannot be used on Local Sites.
- Version Added::
- 3.0.16
Request Parameters¶
emailString | The e-mail address of the user to create. |
first_nameString | The first name of the user to create. |
is_activeBoolean | Whether the user should be allowed to log in to Review Board. Added in 3.0.16 |
last_nameString | The last name of the user to create. |
render_avatars_atString | A comma-separated list of avatar pixel sizes to render. Renders for each specified size be available in the avatars_html dictionary. If not provided, avatars will not be rendered. |
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. |
Examples¶
application/vnd.reviewboard.org.user+json¶
$ curl http://reviews.example.com/api/users/admin/ -H "Accept: application/json"
Vary: Accept, Cookie
ETag: a73006b40f16f76cad4f64a3f4f7193e74ec40df
Content-Type: application/vnd.reviewboard.org.user+json
X-Content-Type-Options: nosniff
{
"stat": "ok",
"user": {
"avatar_html": null,
"avatar_url": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=48&d=mm",
"avatar_urls": {
"1x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=48&d=mm",
"2x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=96&d=mm",
"3x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=144&d=mm"
},
"email": "admin@example.com",
"first_name": "Admin",
"fullname": "Admin User",
"id": 1,
"is_active": true,
"last_name": "User",
"links": {
"api_tokens": {
"href": "http://reviews.example.com/api/users/admin/api-tokens/",
"method": "GET"
},
"archived_review_requests": {
"href": "http://reviews.example.com/api/users/admin/archived-review-requests/",
"method": "GET"
},
"muted_review_requests": {
"href": "http://reviews.example.com/api/users/admin/muted-review-requests/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/users/admin/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/users/admin/",
"method": "PUT"
},
"user_file_attachments": {
"href": "http://reviews.example.com/api/users/admin/user-file-attachments/",
"method": "GET"
},
"watched": {
"href": "http://reviews.example.com/api/users/admin/watched/",
"method": "GET"
}
},
"url": "/users/admin/",
"username": "admin"
}
}