Cato Networks Knowledge Base

Using the Cato Site Creation API with Postman (EA)

  • Updated

This article explains how to use the Postman API client and execute Cato’s APIs to provision sites in the Cato Management Application.

Note

Note: This is an Early Availability (EA) feature that is only available for limited release. For more information, contact your Cato Networks representative or send an email to ea@catonetworks.com.

Overview of Configuring Postman

This is a high-level overview of configuring Postman to run Cato's configuration API to provision and update sites.

  1. Generate the API key from the Cato Management Application.

  2. Download and import the Postman Collection and Environment.

  3. Configure the Environment.

  4. Run the API and provision sites in the account.

Generating the API Key from the Cato Management Application

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.

API Keys.png

To generate an API key for the Cato Creation API:

  1. In the navigation menu, click Administration > API Management.

  2. On the API Keys tab, click New. The Create API Key panel opens.

    image2.png
  3. Enter the Key Name.

  4. Set the API Permission to Edit.

  5. We recommend setting a date that the API key will Expire at.

  6. Click Apply. The API key is added and a popup window containing the new API key is displayed.

  7. Click copy.png (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.

    image3.png
  8. Click OK to close the pop-up window.

Adding the Cato API Collection and Environment to Postman

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:

  1. Download the custom Collection and Environments from this KB article to your device.

  2. From Postman, select File > Import. The Import pop-up window opens.

  3. Click Upload Files, and then select the files you downloaded in step 1.

    Import_Files.png
  4. Click Import.

The custom Environment is now shown in the Postman Environments:

image6.png

The custom Collection is now shown in the Postman Collections:

image7.png

Configuring the Postman Environment

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:

  1. From the Environment tab, right-click the template _cat_env_template_ and select Duplicate.

    image8.png
  2. Right-click the copy of the Environment select Rename, then rename the Environment to the name of your Cato tenant.

    image9.png
  3. 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.

    image10.png

    You can retrieve the CMA account ID directly from the URL:

    image11.png

Running the Cato API Call to Provision Sites

After you define the API Key and CMA account ID for the Postman

To execute the API call and provision sites:

  1. On the Collections tab.

  2. In the upper-right corner, select the Environment you created in the previous step.

    image12.png
  3. From the Collections tab, expand Cato Mutation API v1 > addSocketSite > _query and select query_stateCode.

    image13.png
  4. Click Send to execute the API call. The expected result is 200 OK and some data.

    image14.png

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.