REST API

ztC Endurance systems support the Representational State Transfer (REST) application programming interface (API). With access to the REST API operations, you can collect system information and execute some administrative tasks. You can use the REST API to monitor and manage the ztC Endurance system from any location that can access the system over the network.

The system provides the REST API and interactive REST API documentation through the OpenAPI (also known as Swagger™) Specification. You can access the documentation directly on the ztC Endurance system.

To begin exploring the REST API on ztC Endurance systems, see the following sections:

Accessing the REST API Documentation

In a Web browser, open the following URL, which includes one of the hostnames or IP addresses of your ztC Endurance console​:

https://console_hostname_or_IP address/apidoc

For example, if the hostname of your ztC Endurance console​ is https://sys22.yourcompany.com, the URL for the REST API documentation is https://sys22.yourcompany.com/apidoc.

The URL takes you to the REST API documentation page. This page describes the API operations and syntax, and provides a helpful interface you can use to try the operations on your own system.

Logging In for REST API Testing

Note: Most operations on the REST API documentation page do not require you to perform the following procedure and instead simply require you to enter a username and password after you click Execute. However, if you want to use all operations listed on the REST API documentation page, you must perform the following procedure.
  1. Open the REST API documentation page.

  2. Click session_api to expand it. The system displays the syntax for the session_api operation.

  3. Click POST /sessions to expand it, and then click Try it out.

  4. Under LoginRequest, replace string next to username and password with the username and password for a user account with the appropriate level of privileges for the REST API operations that you want to perform. The new username and password appear in bold in the following example.

    {
      "username": "admin",
      "password": "admin"
    }
    
  5. Click Execute.

  6. {
      "authToken": "a8ab7d17f4f3721494eb646ce81dfc24",
      "email": "jbrown@abccompany.com",
      "maxAge": 600000,
      "role": "admin",
      "status": "success"
    }
  7. Upon a successful login, copy the authorization token text located between the quotation marks for use in a subsequent step.

  8. At the top of the REST API documentation page, on the right side, click Authorize.

  9. Under key (apiKey), in the Value field, paste the authorization token text, and then click Authorize. This saves your authentication token in the request header for any operations that you “execute” from the REST API documentation page.

    Note: The token expires after 10 minutes, and you need to repeat this step to create a new token.

    To clear the token, use the Logout button next to it on the Authorize dialog box.

  10. Click Close or X to close the dialog box and return to the REST API documentation page.

  11. Proceed with your REST API testing.