This article explains how to use the Postman API client and execute Cato’s APIs to provision sites in the Cato Management Application.
This is a high-level overview of configuring Postman to run Cato's configuration API to provision and update sites.
-
Generate the API key from the Cato Management Application.
-
Download and import the Postman Collection and Environment.
-
Configure the Environment.
-
Run the API and provision sites in the account.
The API key is a code that the API client uses to authenticate with your Cato account. You can use the API Management screen in the Cato Management Application to generate an API key with Edit permissions.
To generate an API key for the Cato Creation API:
-
In the navigation menu, click Administration > API Management.
-
On the API Keys tab, click New. The Create API Key panel opens.
-
Enter the Key Name.
-
Set the API Permission to Edit.
-
We recommend setting a date that the API key will Expire at.
-
Click Apply. The API key is added and a popup window containing the new API key is displayed.
-
Click (Copy) and copy the API Key that is generated by the Cato Management Application and save it to a secure location.
Once you close this window, you can't access the value for the API key.
-
Click OK to close the pop-up window.
We created a custom Postman Collection and Environment to help you get started provisioning sites with the Cato Creation API. These custom files are attached to this article: Configuration API Scripts (EA)
- _cato_env_template_.postman_environment.json
- Mutation API files for the configuration API (such as Cato Site Mutation API v1.postman_collection.json)
The Postman Environment contains variables (API URL, CMA Account ID, etc...) and the Postman Collection contains examples of GraphQL Mutation API calls. To import them, click on “Import”, drop the file into the windows and click on import:
To add the Collection and Environment for the Cato API to Postman:
-
Download the custom Collection and Environments from this KB article to your device.
-
From Postman, select File > Import. The Import pop-up window opens.
-
Click Upload Files, and then select the files you downloaded in step 1.
-
Click Import.
The custom Environment is now shown in the Postman Environments:
The custom Collection is now shown in the Postman Collections:
We recommend that you use a separate Postman Environment for each Cato Tenant where you store the CMA Account ID and the API Key.
To create a new Postman environment:
-
From the Environment tab, right-click the template _cat_env_template_ and select Duplicate.
-
Right-click the copy of the Environment select Rename, then rename the Environment to the name of your Cato tenant.
-
Copy the API Key and CMA Account ID, and paste them into the Current Value of the relevants fields in the Environment and click Save.
You can retrieve the CMA account ID directly from the URL:
After you define the API Key and CMA account ID for the Postman
To execute the API call and provision sites:
-
On the Collections tab.
-
In the upper-right corner, select the Environment you created in the previous step.
-
From the Collections tab, expand Cato Mutation API v1 > addSocketSite > _query and select query_stateCode.
-
Click Send to execute the API call. The expected result is 200 OK and some data.
0 comments
Please sign in to leave a comment.