Join the Conversation

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

Gen 6 API administrator password change

GeeGee Newbie ✭
edited December 2020 in Developer Hub

Device: NSA 2650

Firmware : SonicOS Enhanced 6.5.4.7-83n

Gen 6 request URL:

https://x.x.x.x:x/api/sonicos/administration/password/old-password/password/new-password/password123/confirm-password/password123

Response:

{

    "status": {

        "success": false,

        "cli": {

            "mode": "administration_mode",

            "depth": 2,

            "command": "admin-password old-password password new-password password123 confirm-password password123",

            "configuring": true,

            "pending_config": false,

            "restart_required": "FALSE"

        },

        "info": [

            {

                "level": "error",

                "code": "E_NO_MATCH",

                "message": "No matching command found."

            }

        


The issue is the hyphen in admin-password.

Is their a way to get around this? Would it be possible to request using direct/cli?

If so, where can I find the JSON layout to achieve this?


Thanks!

Category: Developer Hub
Reply

Answers

  • Hello @Gee,

    I tried this over CLI and could successfully do it using the following commands.

    config(HomeTZ_300)# administration

    (config-administration)# admin password old-password password new-password PASSWORD confirm-password PASSWORD

    % Processing request...

    % Status returned processing command:

      admin password old-password password new-password PASSWORD confirm-password PASSWORD

    % Changes made.

    (config-administration)# commit

    % Applying changes...

    % Status returned processing command:

      commit

    % No changes made.

    But, while using API, I get the exact same error that you are getting.

    Just for testing I tried this on a Gen 7 device (NSv 870) and could do it successfully using the following:

    Request URL:

    https://x.x.x.x/api/sonicos/administration/password

    Body:

    {

      "administration": {

        "admin_password": {

          "old": "password",

          "new": "PASSWORD"

        }

      }

    }

    Response:

    {

        "status": {

            "success": true,

            "cli": {

                "mode": "config_mode",

                "depth": 1,

                "configuring": true,

                "pending_config": false,

                "restart_required": "FALSE"

            },

            "info": [

                {

                    "level": "info",

                    "code": "E_OK",

                    "message": "Success."

                }

            ]

        }

    }

    Unfortunately, the same did not work for me on a Gen 6 appliance. I will research some more and let you know what I find.

    Thank you!

    Shipra Sahu

    Technical Support Advisor, Premier Services

Sign In or Register to comment.