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 | Root List Resource |
Child Resources | None |
Anonymous Access | Yes, if anonymous site access is enabled |
Links¶
Name | Method | Resource |
---|---|---|
delete | DELETE | Session Resource |
self | GET | Session Resource |
user | GET | User Resource |
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 |
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 |
Examples¶
application/vnd.reviewboard.org.session+json¶
$ curl http://reviews.example.com/api/session/ -H "Accept: application/json"
Vary: Accept, Cookie
Content-Type: application/vnd.reviewboard.org.session+json
X-Content-Type-Options: nosniff
{
"session": {
"authenticated": true,
"links": {
"delete": {
"href": "http://reviews.example.com/api/session/",
"method": "DELETE"
},
"self": {
"href": "http://reviews.example.com/api/session/",
"method": "GET"
},
"user": {
"href": "http://reviews.example.com/api/users/admin/",
"method": "GET",
"title": "admin"
}
}
},
"stat": "ok"
}