Join the Conversation

To sign in, use your existing MySonicWall account. To create a free MySonicWall account click "Register".

Options

get-cloud-tenants 401 error

st0utst0ut Newbie ✭

What are we supposed to use for a username? This is resulting in a 401 error.

https://api.mysonicwall.com/api/hgms/get-cloud-tenants?username=activation%40fairoaksit.com&isforced=false&bisfromCSC2=false

Category: Developer Hub
Reply

Answers

  • Options
    st0utst0ut Newbie ✭

    For those following alone
    The documentation for the API is absolute garbage:

    This isnt accurate:
    "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, https://api.mysonicwall.com/api/hgms/get-cloud-tenants."

    it is is something like this:
    import requests
    url = "https://api.mysonicwall.com/api/hgms/get-cloud-tenants"
    params = {    "username": "MYUSERNAME",    "isforced": "false",    "bisfromCSC2": "false"}
    headers = {    "accept": "text/plain",    "X-API-KEY": "MY API KEY"}
    response = requests.get(url, headers=headers, params=params)
    print(response.status_code)print(response.text)  # Since the accept header is 'text/plain', print the text content of the response

    Now what state are isforce and bisfromCSC2 need to be in who knows do those need to wexists also who knoow

    I do know that my 401 error is now a 200 but getting

    {"operationStatus":"NOK","msgCode":"MSWAPP:UNAUTHUSER","msgId":"101","msgDesc":"You are not authorized."}




Sign In or Register to comment.