Skip to main content

POST– Create a session

Create a session resource for further access authentications.

Request URL

POST https://<BMC_IPADDR>/redfish/v1/SessionService/Sessions

Request body

FieldTypeDescription

UserName

StringThe username who creates this session.

Password

StringThis property is used in a POST to specify a password when creating a new session. This property is null on a GET.

Response body

FieldTypeDescription

UserName

StringThe username who creates this session.

Password

StringThis property is used in a POST to specify a password when creating a new session. This property is null on a POST response.

SessionType

String"Redfish"

Name

StringA session id value

Id

StringA session id value

Response header

FieldDescription
LocationLink to the session resource created.
X-Auth-TokenAn authentication code is generated when a new session is created.

Status code

HTTP Status CodeError Message ID
201Created
401NoValidSession
403SessionLimitExceeded
500InternalError

Example

The following example is POST body.

{
"UserName" : "USERID",
"Password" : "PASSW0RD"
}

The following example JSON response is returned:

{
"@odata.id": "/redfish/v1/SessionService/Sessions/6",
"Password": null,
"@odata.type": "#Session.v1_2_1.Session",
"Id": "6",
"SessionType": "Redfish",
"@odata.etag": "\"1470b92b471825a097d \"",
"Name": "6",
"UserName": "USERID"
}