Join the Conversation

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

Post producutlist-customer not returning data

Hello, i am using the mysonicwall api, and i am trying to get a list of products using the endpoint:

"/api/users/productlist-customer"

There are a few pieces of data in the schema that i would expect the endpoint to return, but it is not. I wonder if there is a body request parameter that i am missing in order to do this ?

I am not sure.

There are few things:

  • i would expect the prodList to be populated, it is not (but this is not critical)
  • what i need is the contents of "productGroupLicense" to be fully populated. I require parameters like "totalProducts", "endPointsCount", "cloudUsersCount", and so on.

I wonder why these are not populated or if there is anything i can do to get the desired response.


Any help would be appreciated, thanks.

Category: Developer Hub
Reply

Answers

  • skesarwaskesarwa SonicWall Employee

    This is what i am getting. Snippet Below: -

    Note: - I do not have any products register in my Name. I just have one CC license activated in this account.

    Let me know if you have any follow up questions.

    Thanks & Regards,

    Santosh.

  • tstacct1tstacct1 Newbie ✭
    edited March 12

    I didn't get the detail also from the product list

  • tstacct1tstacct1 Newbie ✭

    I expect  "prodList" to be populated like in the example (https://api.mysonicwall.com/mssp.html), is there any required option/parameter for that ?

  • Michael_McCoolMichael_McCool Newbie ✭
    edited April 3

    I'm a newbie myself, but I've sussed out a few items. I used the dev tools in the browser an saw what the WebUI was using to populate the product list. Once I added these fields to the POST body, I then got data in the prodList value. The prodList data was blank prior to this.

    {
    "filterByProductType": null,
    "productGroupName": null,
    "forceFetch": true,
    "isPaged": "NO",
    "lastRegistered": "-1"
    }

    It's most likely setting forceFetch to true which is causing the query to return all the product details.

    Edit: Here is the powershell script that retrieves the data.

    $script:MswKey=<MSW Key>
    $script:headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
    $headers.Add("Content-Type","application/json")
    $headers.Add("x-api-key",$MswKey)
    function Get-MySonicWallProductList {
        $uri='https://api.mysonicwall.com/api/users/productlist-customer'
        $body=[PSCustomObject]@{
            filterByProductType = $null
            productGroupName = $null
            forceFetch = $true
            isPaged = "NO"
            lastRegistered = "-1"
        }
        $BodyJSON = $Body | ConvertTo-Json -depth 6
        $Response=Invoke-RestMethod -Headers $script:headers -Uri $uri -Method Post -body $BodyJSON
        if ($response.operationStatus -eq 'OK'){
            $response.content
        }
    }
    $ProductList=Get-MySonicWallProductList
    $ProductList
    

Sign In or Register to comment.