MySonicWall API Reference Guide

Generating NSM Token using MySonicWall API Key

You can generate the NSM token using MySonicWall API key.

To generate NSM token using MSW API key

  1. Get your tenantId and tenantserial using the MSW API Key.

    You can find tenantId and tenantserial on the MySonicWall Swagger page under General category with API call, GET https://api.mysonicwall.com/api/hgms/get-cloud-tenants.

  2. Get an access code for your tenant using the MSW API Token and the tenantId.

    Replace the YOURTENANTID with tenantid you received in step 1 and replace YOURAPIKEY with APIKEY generated according to Generating MSW API Key in the below curl example.

    Curl-based example: curl https://api.mysonicwall.com/api/generate-cscaccesscode -X POST -d "{\"tenantId\":\"YOURTENANTID\",\"tileName\":\"ISNSMSAFEENABLED\"}" -H "Content-Type: application/json" -H "X-API-KEY: YOURAPIKEY"

  3. Generate the NSM API Token using the tenantserial and access code.

    Replace the YOURTENANTSERIAL with tenantserial you received in step 1 and replace YOURACCESSCODE with code you received in step 2 in the below curl example.

    Curl-based example: curl https://nsm-uswest.sonicwall.com/api/manager/auth/sso -H "Content-Type: application/json" -X POST -d "{\"tenantserial\":\"YOURTENANTSERIAL\",\"code\":\"YOURACCESSCODE\"}"

  • Use the NSM API Token for NSM API calls for that specific tenant.
  • The NSM API token you generated is valid for 8 hours. It has an inactivity timeout of 15 minutes. This is tied to the session timeout for your user in NSM. You can extend the inactivity timeout to the maximum of 8 hours through the NSM UI.
  • The tenantserial is not same as tenantId. The tenantserial for NSM is available as a separate parameter in response body of step 1.
  • Your NSM region is the domain for the SonicWall NSM portal you log into. For Europe region, NSM URL should be changed to https://nsm-eucentral.sonicwall.com/api/manager/auth/sso.

Was This Article Helpful?

Help us to improve our support portal

Techdocs Article Helpful form

  • Hidden
  • Hidden

Techdocs Article NOT Helpful form

  • Still can't find what you're looking for? Try our knowledge base or ask our community for more help.
  • Hidden
  • Hidden