Configuring the Postman REST API Client
Zscaler supports the Windows, macOS, and Linux versions of the Postman REST API app. To learn more about the app and its features, refer to the Postman documentation.
If you already have Postman installed and configured, you can download the latest version of the cloud service API and Sandbox Submission API Postman collection files from any article within the Reference Guide.
The Sandbox Submission API uses a base URL that is different from that of the cloud service API. It also requires an API token. Make sure that both are set properly within Postman for your Zscaler cloud. To learn more, see Getting Started.
Installing and Configuring Postman for Windows, macOS, or Linux
To install and configure Postman:
- Go to the Postman website and download the app for your OS (i.e., Windows, macOS, or Linux).
For this example, the 64-bit version of the Postman application running on Windows is used to illustrate the instructions.
- Install the app.
- After installation, open the app and log in using your account.
- Download the latest version of the cloud service API collection file from the Reference Guide.
- From the main window, click Import.
Alternatively, go to the application menu on the top-left corner and click File > Import....
- In the Import window that appears, select your .postman_collection file or drag the file to the selection area.
After the file is imported, a new folder with the name used within the Postman collection file (e.g., cloud service API) is displayed within Collections.
- Ensure that No Environment is selected in the environment drop-down menu on the top right, and then click the Environment quick look icon.
- Click Add.
- On the New Environment tab that appears, complete the following steps:
- Enter a descriptive name for the environment (e.g.,
Zscaler Test Environment
). - Under Variable, enter
url
. - For Type, leave as default.
- For Initial Value, enter
https://zsapi.<Zscaler Cloud Name>/api/v1
, where<Zscaler Cloud Name>
is the cloud name provisioned for your organization by Zscaler (e.g.,zsapi.zscalerbeta.net
). To learn more, see What Is My Cloud Name for ZIA? - Click Save and close the tab.
- Enter a descriptive name for the environment (e.g.,
Select the environment you configured (e.g., Zscaler Test Environment
) from the environment drop-down menu on the top right. To learn more, refer to the Postman documentation.
Authenticating a Session in Postman
After installing and configuring the Postman app, authenticate a session.
- Log in to the ZIA Admin Portal using your API admin credentials. To learn more, see Getting Started.
- Go to Administration > Cloud Service API Security > Cloud Service API Key.
- On the Cloud Service API Key tab, copy the Key.
- In the Postman app:
Alternatively, go to the application menu on the top-left corner and click File > Settings.
- Under the General tab, turn off SSL certificate verification.
- In the Postman collection you imported previously, select the POST Authenticate request.
- Go to the Pre-request Script tab and replace YourApiKey in the script with the Key you copied in step 3.
- Go to the request's Body tab and replace the username and password with your API admin credentials.
- Click Send.
If authentication is successful, a Status 200 OK message is returned, for example:
Making an API Call in Postman
Make an API call using Postman. The following example shows how to look up categories for a specified list of URLs using /urlLookup:
- Make sure that you can authenticate successfully.
- Go to URL categories > POST URL lookup.
Click the request's Body tab to view the list of reconfigured URLs for which the lookup operation must be performed. You can look up a maximum of 100 URLs per request, with each URL not exceeding 1024 characters.
- Click Send.
If the request is successful, you should receive a Status 200 OK message and a response Body that looks as follows:
You can see the JSESSIONID
under the Cookies tab.
By default, the session is terminated after 30 minutes and reauthentication is required. However, the time interval can be changed, from 5 minutes to 600 minutes (10 hours), within the ZIA Admin Portal. To learn more, see Configuring Advanced Settings.