Using the REST API

The REST API is intended to be used by a script or program to interact with and control BMC Helix Discovery from a remote machine. You can use the API for a variety of tasks, such as:

  • Submitting discovery runs
  • Managing credentials
  • Querying the data in your system
  • Uploading TKUs

The aim of the API is to enable you to perform most tasks that you can currently do through the BMC Helix Discovery UI. 

The API follows the REST architectural style, so resources, HTTP verbs, and status codes are used. JSON is used for request and response bodies. The endpoints provided by the API are specified using the Swagger specification language. All endpoints use the OAuth 2.0 protocol for authentication.

This topic explains how to submit your first request to the REST API.

Configuring HTTPS

The API is only accessible over HTTPS.

Authenticating with a token

Requests to every endpoint in the REST API must be made on behalf of a BMC Helix Discovery user. The authentication mechanism is token-based.


Calling the API

Calls to the API can be made from any scripting or programming language that supports HTTP. An extremely simple example is the command line tool curl. A request to the same /discovery endpoint as above, using curl, looks like:



curl -i -X GET -H 'Authorization: bearer <your_token>' 'https://appliance/api/v1.0/discovery'

HTTP/1.1 200 OK
{
    "running": false,
    "status": "running"
}

curl is used for example API requests in other topics in this section.Whatever client language or tool you use to call the REST API, it is recommended you read all related topics first to see how to construct valid requests and handle responses.

Was this page helpful? Yes No Submitting... Thank you

Comments