Authenticating to SonicWall Firewall API using POSTMAN

Description

SonicOS API provides an alternative to the SonicOS Command Line Interface (CLI) for configuring various functions. SonicOS API is enabled by default in SonicOS 7.0 and SonicOSX where as disabled on SonicOS.


This KB explains how SonicOS API can be enabled, and how can you make use of API clients like POSTMAN to get yourself authenticated to the SonicOS API to make changes/configuration/view the settings and lot more

Resolution

The article shows steps to configure SonicWall firewall API to authenticate with API clients such as POSTMAN.


  • Navitage to the SonicWall Firewall Management page and setup the SonicOS API as belowImage


  • Download and Install "Postman API application" from the link: Download Postman | Get Started for Free
  • Open the Postman application once installed, it will take you to the Workspace creation page.
  • Click on Create Request and it will take you the "Untitled workpage" as shown below: 
    Image


  • Enter the URL as "https://<management IP of the firewall>:<management port>/api/sonicos/auth". Make sure to keep the API request method as "POST". 
  • Below picture shows the same, here I am using Default 443 port hence Its not mandatory to put 443. But if its any custom port like 444, 8443 then kindly put on the URL Image


  • Under Authorization, select "Basic auth" from the drop down menu. And enter the Firewall admin credentials.Image



  • Let the "Headers" remain defaultImage


  • Hit "Send", and the below is the result that is expected upon Successful authenticationImage



  • Now you are authenticated, hence you can use any API method/Calls to GET or POST requests. For example: Below is a GET API call requesting Zones information setup on the FirewallImage


NOTE:  Please read the SonicOS API 7.x documentation for more methods of authentication, and for configuration related API call URLs


SonicOS/X API 7.0 (sonicwall.com)

Related Articles

  • SonicOS 8.1.0 FAQ
    Read More
  • SonicWall GEN8 TZs and GEN8 NSas Settings Migration
    Read More
  • Getting started with SonicWall firewalls
    Read More
not finding your answers?