Calling Guardium Insights SaaS APIs

After you create the token header, you can open the API Reference and use the Guardium® Insights SaaS APIs.

Before you begin

To use the API from a command line, Guardium Insights SaaS requires the token header that you created from the Create API key, as described in Creating API keys. Use the encoded token as the Authorization header token.

Premium You can also create and use an OAuth authorization token, as described in Accessing Guardium Insights SaaS APIs with OAuth.

After you create the token header, you can read about and use the APIs from the Insights SaaS API Reference.
Note: When you click the link to the APIs, the next page warns you that you are leaving the IBM website. This message is expected. Click the redirect link to open the API landing page.

From the API landing page, click API Reference to go to the APIs.

The first time that you open the API reference, enter the following information in the API page:
  • Authentication - Paste in the token header that you created in Guardium Insights SaaS.
    Note: Make sure that you include the entire header token as the Authorization header token, including the word Basic followed by a space. For example,
    Basic N2Q1MDEyZGIt...YxZjIzNGJhYQ==
  • URL - Copy the URL from your Guardium Insights SaaS instance, and click the default base URL to display the giurl window. Paste your URL into the giurl window (without the https:// prefix).
Note: Premium If you use OAuth authentication, then you can also authenticate with the OAuth token, as follows:
  1. Call Get access token from the AuthServer API.
  2. Copy the generated command and paste it into a terminal window. For example:
    curl --request GET \
       --url https://mycompany.com/api/v3/oauth/token \
       --header 'accept: application/json' \
       --header 'authorization: Basic YjIwMDUzZT...2JiOmNZMlpqbW52ZVg='
  3. When you run the command, Guardium Insights SaaS returns the following information:
    {"access_token":"4Zt8brtAyw3m9yseT8mfmSgK8kNMimFDIeedpUSe","expires_in":"7200","token_type":"Bearer"}
  4. You can now use the Bearer token for all of your APIs. For example:
    curl --request GET \
       --url https://mycompany.com/api/v3/dashboards \
       --header 'accept: application/json' \
       --header 'authorization: Bearer 4Zt8brtAyw3...imFDIeedpUSe'

At any time, you can select a programming language from the Language ribbon. The API interface offers plenty of choices. The default produces cURL commands.

Procedure

  1. After you authorize the APIS, select the API and method that you need from the table of contents. Depending on the method you select, you might need to provide parameters.
    Often, the API provides a method to get the information that you need. For example, Get CMs, which returns a list of central managers from the tenant database.

    For other APIs, see the parameter description for information.

  2. As you enter parameters, the API window builds the API request. When you are done, click Copy icon to copy the API code.

What to do next

You can now paste the API code into any command window or program, and run it from there.

Note: The Response window is not currently implemented.