Jim Oqvist

How-to use Postman with R80 Security Management API

Discussion created by Jim Oqvist on May 16, 2016
Latest reply on Feb 2, 2018 by Martin Raska

 

What is Postman

Postman is a free Google Chrome extension that can be used for testing and experimenting with web-services

You can find the latest postman collection file for R80 Security Management API here postman_collection.json

 

Installation

1) Launch "Google Chrome" and enter "chrome://apps" in the URL bar.

2) Open "Web Store"

3) Search for "Postman"

    

4) Click on "Add to Chrome" and the following should appear:

    

5) Add the app and then click on "Launch App"

 

Setup Postman to work with the R80 Security Management API

1) You can import a list of APIs into your Postman environment using Postman's "collection" feature. This stored list of APIs can help you avoid syntax errors and save you time finding APIs. The R80 and R80.10 collections for Postman can be downloaded here:

 

2) Launch Postman, and click on the "import collection" button.

    

 

3) Select "choose files" and select the collection file that you have. After selecting the file, you should see something like this:

    

 

4) On the left part of the screen, you should now see the text similar to "Web API – take hero3– 991000104". Click on this text, to see the list of API calls grouped by categories.

    

 

5) To set-up the environment variable, click on "Manage environments" and click on add

     ---->

 

6) Add a key called "server" and set it with the value: https://<your-mgmt-ip-address>/web_api

 

7) Add a key called "session", you can leave its value empty.

 

8) Click the "Add" button, to exit this dialog.

 

9) Click the "X" button to exit the “Manage Environments” screen

    

Activating and testing the R80 Security Management API

1) Open SmartConsole R80, and login to the R80 Security Management

 

2) When the GUI is opened, go to : Manage & settings -> Blades -> Management API -> Advanced Settings

 

3) Check “Automatic start”, and pick “All IP Addresses that can be used for GUI clients or All IP addresses”.

 

4) Press OK

    

 

5) Publish

 

6) Run the command api reconf from clish

 

7) Make sure the management API server is up and running. Browse to: https://<your-mgmt-ip-address>/api_docs/

     You need to accept the self signed certificate warning

    

 

8) You should now see the R80 Management API reference guide

    

 

9) In postman:

(A) change the postman environment to the one you set in the previous step.

(B) locate the "Login" command in the list of APIs on the left and click on it.

(C) Change the values for the user-name and password.

(D) Click on the "send" button

    

 

10) The output of the "Login" command contains a session-ID (sid) value. This value should be used by all other API calls in the same session as a way to prove the authenticity of the user behind the API call. To set the session-ID for subsequent API calls select the sid value, right click and select "Set:<My Local R80 Demo>" -> "session".

    

 

11) You're done! Choose any other API calls from the collection and run it.

Outcomes