Get Session
Returns information about the current session. This operation expects a valid session token to be supplied. A side effect of invoking this operation may be a change to the session’s last accessed time to the current time if this is supported by the session implementation. Invoking any other operation in the API will also update the session’s last accessed time.
This API is meant to serve the needs of various front end projects that may want to display the name of the user. Examples of this include various web based user interfaces and logging facilities.
Request
URLURL
Header Parameters
Header Parameters
Required basic authentication header. Takes in a Base64 encoded value of your username:password
Authorization example
"Basic dXNlcm5hbWU6cGFzc3dvcmQ="
Authentication
Response
Response BodyResponse Body
Information about the session.
{
"created_time": "string",
"last_accessed_time": "string",
"user": "string"
}
Time when the session was created.
Last time this session was used by passing the session token for invoking an API.
Fully qualified name of the end user that created the session, for example Administrator@vsphere.local. A typical use case for this information is in Graphical User Interfaces (GUI) or logging systems to visualize the identity of the current user.
Errors
com.vmware.vapi.std.errors.unauthenticated : if the session id is missing from the request or the corresponding session object cannot be found.
com.vmware.vapi.std.errors.service_unavailable : if session retrieval fails due to server specific issues e.g. connection to back end component is failing. Due to the security nature of this API further details will not be disclosed in the error. Please refer to component health information, administrative logs and product specific documentation for possible causes.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
cURL Command
Vendor Extensions
x-vmw-doc-deprecated-method: get
x-vmw-doc-deprecated-path: /rest/com/vmware/cis/session
x-vmw-doc-operation: get