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.
From the API landing page, click API Reference to go to the APIs.
- 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).
- Call Get access token from the AuthServer API.
- 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='
- When you run the command, Guardium
Insights SaaS returns the
following information:
{"access_token":"4Zt8brtAyw3m9yseT8mfmSgK8kNMimFDIeedpUSe","expires_in":"7200","token_type":"Bearer"}
- 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
What to do next
You can now paste the API code into any command window or program, and run it from there.