SonicOS API provides an alternative to the SonicOS Command Line Interface (CLI) for configuring selected functions. SonicOS API is disabled by default in SonicOS.Â
To use the SonicOS API, you must enable it, either through the SonicOS Management Interface or from the CLI.
SonicOS API is supported on all platforms on GEN7 and running SonicOS 6.5.4 and higher for GEN6.
This release includes significant user interface changes and many new features that are different from the SonicOS 6.5 and earlier firmware. The below resolution is for customers using SonicOS 7.X firmware.


 NOTE: https://IP-address:port/-- Replace this with your SonicWall's Public or private IP address with the right management port number (If the management port is 443, you can directly use https:// followed by the IP address without the port number too).

 

curl --location --request POST 'https://192.168.168.168/api/sonicos/auth' \--header 'Accept: application/Json' \--header 'Content-Type: application/Json' \--header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=
--data-raw '{"override" : true}'
curl -L -X POST 'https://192.168.168.168/api/sonicos/restart' \-H 'Content-Type: application/Json' \-H 'Accept: application/Json' \-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \-d ''
curl -L -X POST 'https://192.168.168.168/api/sonicos/restart/in/10/minutes' \-H 'Content-Type: application/Json' \-H 'Accept: application/Json' \-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \-d ''
curl -L -X DELETE 'https://192.168.168.168:443/api/sonicos/auth' \-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ='This release includes significant user interface changes and many new features that are different from the SonicOS 6.2 and earlier firmware. The below resolution is for customers using SonicOS 6.5 firmware.

 TIP: You are free to choose Swagger, Postman, Git bash, or any application that allows API calls, if you are using a Linux based operating system you can execute cURL from the terminal. For this article I am using Git bash on Windows.

 NOTE: https://IP-address:port/-- Replace this with your SonicWall's Public or private IP address with the right management port number (If the management port is 443, you can directly use https:// followed by the IP address without the port number too).

 

curl --location --request POST 'https://192.168.168.168/api/sonicos/auth' \--header 'Accept: application/Json' \--header 'Content-Type: application/Json' \--header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=
--data-raw '{"override" : true}'
curl -L -X POST 'https://192.168.168.168/api/sonicos/restart' \-H 'Content-Type: application/Json' \-H 'Accept: application/Json' \-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \-d ''
curl -L -X POST 'https://192.168.168.168/api/sonicos/restart/in/10/minutes' \-H 'Content-Type: application/Json' \-H 'Accept: application/Json' \-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \-d ''
curl -L -X DELETE 'https://192.168.168.168:443/api/sonicos/auth' \-H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ='