Skip to main content

POST /sessions

Use this method to create a new session with (log in to) Lenovo XClarity Administrator.

Important
When running automated scripts, if you want the session to respect the inactivity timeout, add the X-NOT-USER-INPUT field with a value of checkSession to the request header of each request. Adding this header implies that the session times out based on the inactivity timeout value. If the session times out, the session is not renewed, although active requests for uploading and downloading data are not canceled.

Authentication

Authentication is not required.

Request URL

POST https://{management_server_IP}/sessions

Query parameters

None

Request body

ParametersRequired / OptionalTypeDescription
passwordRequiredStringPassword for the user account.
UserIdRequiredStringUser name for the account to be used to log in to Lenovo XClarity Administrator.
The following example creates a new session.
{
"password": "passw0rd",
"UserId": "test"
}

Response codes

CodeDescriptionComments
200OKThe request completed successfully.
400Bad RequestA query parameter or request attribute is missing or not valid, or the operation is not supported. A descriptive error message is returned in the response body.
500Internal Server ErrorAn internal error occurred. A descriptive error message is returned in the response body.

Response body

AttributesTypeDescription
responseObjectInformation about each session.
 pwChangeRequiredBooleanIndicates whether the password must be changed the next time this user ID is used to log in to Lenovo XClarity Administrator. This can be one of the following values.
  • true. The password must be changed.
  • false. The password is not required to be changed.
 sessionObjectInformation about the user session
  AddressStringIP address of the server from which the user is connected
  authenticationServerStringIP address of the authentication server
  createdStringDate and time when the user logged in and the session was started
  csrfStringCross-Site Request Forgery token for the session
  idStringSession ID
  idleForStringAmount of time, in seconds, that the session has not had activity
  inactivityTimeoutStringAmount time of inactivity, in seconds, after which the session is closed and the user is logged out
  lastAccessedStringDate and time when the user performed the last action
  UserIdStringUser ID
resultStringResults of the request. This can be one of the following values
  • success. The request completed successfully.
  • failure. The request failed. A descriptive error message was returned.
messagesArrayInformation about one or more messages
 explanationStringAdditional information to clarify the reason for the message
 idStringThe message identifier of a returned message
 recoveryArrayRecovery information
  textStringUser actions that can be taken to recover from the event
  URLStringLink to the help system for more information, if available
 textStringMessage text associated with the message identifier
The following example is returned if the request is successful.
{
"response": {
"pwChangeRequired": false,
"session": {
"Address": "10.41.44.187",
"authenticationServer": "127.0.0.1",
"created": "2019-01-25T15:56:44Z",
"csrf": "jbrnbSKznHM4ppOUMTDm-A5JcNNf46AXVNvX98lsRIvGc3Ryav3uTJUmTSP7-gPYacBtIrsEwjEs1IhSxU7_djeE3r_6--PKoa6_5Ois-m7LeMyzAepQaWz6U9W339wM5crBfEdfbecZkJid1cNi6zggAW5O5A0dKKmdlN1FThrbEh0BjfJvcloz0-YrLQxpN0yNbtNef7t-rxSqRpzIFz63Q40it1SjDg0Ldncy2Wxo6bhfC6xBRZBDzgjBgvD7z7sEjgOpvGWgXRYt6gGSlaqpYnHveb90yGfMW3y4Yp8WUp1OmSH8o3DA3qDfJBsYfQ17cJFHVPEgyQrONYFdZA",
"id": "19lee2n050duf10sew3a6l49gs",
"idleFor": "0",
"inactivityTimeout": "1440",
"lastAccessed": "2019-01-25T15:56:44Z",
"UserId": "USERID"
}
},
"result": "success",
"messages": [{
"explanation": "",
"id": "FQXHMSE0001I",
"recovery": {
"text": "Information only; no action is required.",
"URL": ""
},
"text": "The request completed successfully."
}]
}