BAO Login and Logout calls
Logs the user in and out of the
server.
This topic includes the following sections:
For an overview of logging into the API server, getting an authentication token, and logging out, see Logging-into-the-API-server.
For more information about request and response headers, see HTTP request and response headers.
Login
Request
HTTP method: POST
URL: https://<hostname>:<port>/<baocdp|baoap>/rest/login
This is the URL for the
component you are accessing. It includes the host name, corresponding port, and
component (CDP or AP).
Request body properties
Property | Description |
---|---|
username | User name |
password | Password |
Example request JSON
Host: <hostname>:<port>/baocdp
Request Headers
Content-type: application/json
{
"username" : "<yourUsername>",
"password" : "<yourPassword>"
}
Response
If successful, this method logs you into the API server and returns an authentication token.
Response body properties
Property | Description |
---|---|
login | Login request status |
Example response JSON
Status Code: 200 OK
Authentication-Token: /DwG7gAAAAAAAAAASSIUSHVVSysr/3fHRkbS9sJdUeGqHdbliWdOloDrSntnkZKnZZmXveOpKFWtZCLX/oSJv1UgJDp38Cc2fe8FhZe1xl2+LlmoYJEo4ouBnZaCA8M8kNY+04icmspDSYJnsDoa3bCFK/
xvyR3xrux3zZxEPrxnI1/5dxKy0MJqrO4RYq6QIl+Pz+JwTwZuvD9mv1xli0HL3ffqYmLBMpLJv9aegihLUsKWAV4xRCBvZbzlQQh3UFFDtVDMjkx0TFYbQg8aa30zk7ZB8nCQdQfm5pyNJdkVHo5ApObo610AHHz79P0TLsWN0pjQMQwrJNtC
Content-Type: application/json;charset=UTF-8
Date: Wed, 27 May 2015 13:38:04 GMT
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Response Body:
{
"login":"true"
}
From the response header, save the text string returned in the Authentication-Token line. That text string is your authentication token, which you need to include in future requests.
For example, in the previous response, the following line is the authentication token:
Login status codes and messages
For more details about HTTP response codes, see HTTP response codes.
HTTP code | Message | Description |
---|---|---|
200 | OK | Request succeeded |
400 |
| Bad request An error occurred while logging in. |
401 |
| Unauthorized |
405 |
| Method not allowed |
Logout
Request
HTTP method: POST
URL: https://<hostname>:<port>/<baocdp|baoap>/rest/logout
This is the URL for the
component you are accessing. It includes the host name, corresponding port, and
component (CDP or AP).
Request body properties
Property | Description |
---|---|
Host | The API server URL |
Authentication-Token | The text string that is your authentication token |
Example request JSON
Host: <hostname>:<port>/baocdp
Authentication-Token: /DwG7gAAAAAAAAAASSIUSHVVSysr/3fHRkbS9sJdUeGqHdbliWdOloDrSntnkZKnZZmXveOpKFWtZCLX/oSJv1UgJDp38Cc2fe8FhZe1xl2+LlmoYJEo4ouBnZaCA8M8kNY+04icmspDSYJnsDoa3bCFK/
xvyR3xrux3zZxEPrxnI1/5dxKy0MJqrO4RYq6QIl+Pz+JwTwZuvD9mv1xli0HL3ffqYmLBMpLJv9aegihLUsKWAV4xRCBvZbzlQQh3UFFDtVDMjkx0TFYbQg8aa30zk7ZB8nCQdQfm5pyNJdkVHo5ApObo610AHHz79P0TLsWN0pjQMQwrJNtC
Response
If successful, this method logs you out of the API server.
Response body properties
Property | Description |
---|---|
logout | Logout request status |
Example response JSON
Status Code: 200 OK
Content-Type: application/json;charset=UTF-8
Date: Fri, 29 May 2015 14:05:32 GMT
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Response Body:
{
"logout": "true"
}
Logout status codes and messages
For more details about HTTP response codes, see HTTP response codes.
HTTP code | Message | Description |
---|---|---|
200 | OK | Request succeeded |
400 |
| Bad request An error occurred while logging out. |
401 |
| Unauthorized |
405 |
| Method not allowed |
Related topics