Session Resource¶
Information on the active user’s session.
This includes information on the user currently logged in through the calling client, if any. Currently, the resource links to that user’s own resource, making it easy to figure out the user’s information and any useful related resources.
Details¶
Name | session |
URI | /api/session/ |
Token Policy ID | session |
HTTP Methods | |
Parent Resource | |
Child Resources | None |
Links¶
Name |
Method |
Resource |
---|---|---|
delete | DELETE |
|
self | GET |
|
user | GET |
HTTP DELETE¶
Clears the user’s client session and the session cookie.
This is equivalent to logging out a user. The existing session cookie will be invalidated and will no longer be accepted.
This will return a HTTP 204 No Content.
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 |
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 GET¶
Returns information on the client’s session.
This currently just contains information on the currently logged-in user (if any).
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 |
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.session+json¶
$ curl https://reviews.example.com/api/session/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 325
Content-Type: application/vnd.reviewboard.org.session+json
ETag: 2960cde2be9dc360ebd1c93e8204089df75a7085
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"session": {
"authenticated": true,
"links": {
"delete": {
"href": "https://reviews.example.com/api/session/",
"method": "DELETE"
},
"self": {
"href": "https://reviews.example.com/api/session/",
"method": "GET"
},
"user": {
"href": "https://reviews.example.com/api/users/admin/",
"method": "GET",
"title": "admin"
}
}
},
"stat": "ok"
}