You can generate the NSM token using MySonicWall API key.
To generate NSM token using MSW API key
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
.
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"
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\"}"
https://nsm-eucentral.sonicwall.com/api/manager/auth/sso
.