<< Back to GForge REST API

Entity: Usersession

GET

getCaptcha

Parameters (1)

Name Type Description
request \RequestParameters

Return: mixed|null

getUserFromBasicAuth

Checks to see if Basic HTTP authentication data is in the specified request.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \User|bool

The user, if valid authentication data was provided. False if no data.

getUsersession

Returns the user associated with the current session, or the Nobody user if the session is invalid.

Parameters (0)

Name Type Description
No parameters

Return: \gforge\core\models\api\UserBasic

The authenticated user, or Nobody if the session is not valid.

Name Type Description
id int Unique database identifier for the user
unixName string Short, unix-friendly identifier for the user. This is usually also the user's shell logon.
password string Shared secret for authenticating the user. This value is only set for requests, not for responses.
firstname string First name for the user
lastname string Last name for the user
email string Email address for the user
timezone string Name of the user's time zone (from PHP std list)
status int Account status, 0 = Pending, 1 = Active, 2 = Deleted
externalId string Custom external identifier for use in sync to other systems
isGroup string Y if the specified record is a group, N if it is a single user
ccode string
language string
theme mixed
img_url string Relative path to the user's icon, if any
html_url string Relative path to the user's details page (display)
details_url string Relative path to the user's detail data (API)
isSiteAdmin bool
authMethod string|null
api_url string Relative path to the user's basic data (API)

getValidate

Pings the server to verify the current session is still valid. Returns 200 if authenticated, 401 if the session has expired or is missing.

Parameters (0)

Name Type Description
No parameters

Return: (none)

POST

postUsersession

Creates a new session or refreshes an existing one for the authenticated user.

Parameters (0)

Name Type Description
No parameters

Return: array

Associative array with SessionHash (the session token) and user (UserBasic).

PUT

DELETE

deleteUserSession

Removes an existing user session (logout).

Parameters (1)

Name Type Description
id string Session hash to delete. Optional; site admins only. Defaults to the caller's current session.

Return: array

Associative array with key result: success or not found.