4. Postman & RESTful API
Objective
Get the Postman tool ready to be used with the R81 Management API. Import the R81 Management API postman collection.
Instructions
Step |
Instructions |
||||||
---|---|---|---|---|---|---|---|
1 |
Open the Postman Application that is installed on the Windows Jump Server in your lab environment. Look for the Orange RocketMan: |
||||||
2 |
Disregard any notice to upgrade or add a new collection. |
||||||
3 |
First, we must disable SSL certification verification since our server is using a self-signed SSL certificate. Find the gear icon in the top right and click it: |
||||||
4 |
Select Settings and disable the SSL Certificate Verification. Close the window after it is disabled. |
||||||
5 |
Next click the eye on the top right and click add: |
||||||
6 |
Click Add and use the following to create an environment – Click Add after the values are filled in :
|
||||||
7 |
Next click Save and exit out of the Manage Environments window. |
||||||
8 |
Select the new Environment : |
||||||
9 |
Import R81 Management Collection from the desktop:
|
||||||
10 |
Click on the Collections tab on the left side of the screen to see the R81 Web API calls : |
Objective
Use Postman to do a simple task with the R81 Management API.
Instructions
Step |
Instructions |
|
---|---|---|
1 |
Use the filter at the top of the Postman application and type login into the filter area. Alternately, open the first folder in the collection “01 Session Management”. |
|
2 |
The selections should have changed to only items with login as part of their name. |
|
3 |
Select login, a new tab is opened on the right for this function call. Click the Body |
|
4 |
Change the credentials in the body to the following:
Make sure you keep the formatting JSON compliant. |
|
5 |
Before we click Send, review the {{server}} in the Post Path. This matches our environment and is how Postman knows how to connect to the R81 management server at https://203.0.113.80/web_api |
|
6 |
Now click the blue Send button. |
|
7 |
At the bottom of the page, we have the results that were returned from the API server. There are a number of items to look at: |
|
8 |
Postman will automatically add the contents of the “sid” to the session environment variable we setup earlier. Doing so allows us to run another command and reuse the same session. |
|
9 |
Use the filter to find the add-host option in the Postman Collection. |
|
10 |
Review the body of the message that is in the collection. Change the name and IP address to something different if you prefer : |
|
11 |
Hit the blue Send button and review the status and output from the API server. |
|
12 |
Use the filter to find the publish option and publish your changes: |
|
13 |
Use the filter to find the logout function and logout your session. |