Developing
The BMC TrueSight IT Data Analytics product provides you with the capability of running REST APIs.
You can use various REST clients such as cURL, wget, and REST client browser plugins for running the APIs. The client can consume REST APIs using the standard HTTP and HTTPS protocols, same as those used for connecting to the product UI.
This topic contains the following information:
Supported APIs
The following topics describe the various APIs supported with the product:
Authentication and authorization
You need to authenticate with a user name and password for running the REST operations. Additionally, role-based authorization is required for authenticating into the product and running various operations.
To be able to authenticate, you need to generate the authorization token by running a POST call with the following request URL. You also need to provide the user name and password in the request body (in JSON format).
Request URL
In the preceding URL, the following definitions apply:
- <protocol> refers to the protocol that you want to use for communication with the Console Server.
The value can be one of the following:- http
- https
- <host> refers to the host name of the Console Server.
- <Port> refers to the port number of the Console Server. Default port is 9797.
Output
The response is an authorization token. By default, this token is valid for a period of 60 minutes. After the default period expires, the token cannot be used, you need to generate a new token.
Required headers while running the supported APIs
- Authorization
Pass the authorization token as the value. - Content-Type: application/json
Example
Request URL
"username": "admin",
"password": "admin12345"
}
"username": "admin",
"authToken": "6AkjnOzw9hH8/t5hUAIn7b0rbNI="
}
Logging out of a user session
You can log out and terminate a user session by sending a POST request. You also need to provide the authorization token in the request body (in JSON format).
After you log out from a given session, the authorization token generated earlier does not remain valid. Attempts to reuse the earlier generated token generates an error.
Request URL
In the preceding URL, the following definitions apply:
- <protocol> refers to the protocol that you want to use for communication with the Console Server.
The value can be one of the following:- http
- https
- <host> refers to the host name of the Console Server.
- <Port> refers to the port number of the Console Server. Default port is 9797.
Required headers
- Authorization
Pass the authorization token as the value. For more information, see Authentication and authorization. - Content-Type: application/json
Example
Request URL
"Authorization": "7dNJZSao3zZKjuZ5/o1Z8Ji570Q="
}
"status": "SUCCESS"
}
HTTP status codes
The supported APIs follow the HTTP standard for reporting status. The API responses can include one of the following HTTP status codes.
For a complete list of status codes and their meaning, see Hypertext Transfer Protocol -- HTTP/1.1 status code definitions. To understand the status codes relevant to each API, see the individual API topics.The [confluence_table-plus] macro is a standalone macro and it cannot be used inline. Click on this message for details.