<< Back to GForge REST API

Entity: Usersession

GET

getCaptcha

Parameters (0)

Name Type Description
No parameters

Return: (none)

No return type is defined

getUserFromBasicAuth

Checks to see if Basic HTTP authentication data is in the specified request. If the data is present, tries to authenticate the user with the provided user/pwd.

Parameters (1)

Name Type Description
request \mvcnphp\RequestParameters

Return: \User|boolean

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

getUsersession

Get the user (if any) associated with the current session.

Parameters (0)

Name Type Description
No parameters

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

The user represented by the submitted session ID. The "Nobody" user 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 \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 \type
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 boolean
api_url string Relative path to the user's basic data (API)

getValidate

This service method is meant to ping and verify if the current session is still valid

Parameters (1)

Name Type Description
request \mvcnphp\RequestParameters

Return: null

if the session hash is verified, it will respond with a 200 status, and 401 otherwise

POST

postUsersession

Create a new or refresh an existing User Session.

Parameters (1)

Name Type Description
request \mvcnphp\RequestParameters

Return: array

A JSON object with a property called sessionHash. The value of this property uniquely identifies the combination of user and remote address, and can be submitted as the password in subsequent API requests

PUT

DELETE

deleteUserSession

Remove an existing User Session.

Parameters (1)

Name Type Description
request \mvcnphp\RequestParameters

Return: array

result code, the 200 OK HTTP response indicates that the session has been removed. If the user is not allowed to delete the specified session (or it does not exist), then a 404 response is sent.