Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Error with CLi using "telephony providers edges sites numberplans list"

    Posted 04-21-2025 15:20
    With the CLI, I am getting an ERROR (json: cannot unmarshal array into Go value of type models.Entities)

    gc.exe telephony providers edges sites numberplans list $siteId


    Its working w
    hen using PowerShell and a REST call, I can get data with.

    $WebRequestParams   =   @{
            Uri     =   "https://api.usw2.pure.cloud/api/v2/telephony/providers/edges/sites/$siteId/numberplans"
            Method  =   "Get"
            Headers =   @{
                "Authorization" =   $Token
                "Content-Type"  =   "application/json"
            }
        }
        $Response = Invoke-WebRequest @WebRequestParams | ConvertFrom-Json
        Return $Response

    Am I doing something wrong?

    #PlatformCLI

    ------------------------------
    Pat Johnson
    Sr. Solutions Analyst
    ------------------------------


  • 2.  RE: Error with CLi using "telephony providers edges sites numberplans list"

    Posted 04-21-2025 16:46

    Pat,

    What is the value of $siteId?

    Chad



    ------------------------------
    Chad Markle
    Senior Director of IT Unified Communications
    ------------------------------



  • 3.  RE: Error with CLi using "telephony providers edges sites numberplans list"

    Posted 04-21-2025 18:03
    Edited by Pat Johnson 04-21-2025 18:04

    One of the IDs that I get from.

    gc.exe telephony providers edges sites list

     

    Example "f1s72fbf-95b2-3u1z-8a2b-1f3e4d5c6a7b"



    ------------------------------
    Pat Johnson
    Sr. Solutions Analyst
    ------------------------------



  • 4.  RE: Error with CLi using "telephony providers edges sites numberplans list"

    Posted 04-21-2025 18:33

    If I pass in the Site ID for one of my sites in the "gc telephony providers edges sites numberplans list" CLI command I get results.  Do you have the most recent version of the CLI?  If you are passing in data from from a file perhaps it isn't being structured correctly?



    ------------------------------
    Chad Markle
    Senior Director of IT Unified Communications
    ------------------------------



  • 5.  RE: Error with CLi using "telephony providers edges sites numberplans list"

    Posted 04-21-2025 18:42

    I have downloaded a new gc.exe from ( https://developer.genesys.cloud/devapps/cli/ ) and get the same response. 

    json: cannot unmarshal array into Go value of type models.Entitie

    If I run the CLI without a variable, I also get the error
    "gc telephony providers edges sites numberplans list f1s72fbf-95b2-3u1z-8a2b-1f3e4d5c6a7b"

     json: cannot unmarshal array into Go value of type models.Entitie



    In my "C:\Users\pjohnson\.gc\config.toml"

    I do set my output format to JSON 

    output_format = 'JSON'



    ------------------------------
    Pat Johnson
    Sr. Solutions Analyst
    ------------------------------



  • 6.  RE: Error with CLi using "telephony providers edges sites numberplans list"

    Posted 04-22-2025 18:20

    I'm not explicitly setting output_format in my config.toml file and it defaults to JSON.  I'm not sure why you are getting that error.  Sorry I can't be of more help.

    Chad



    ------------------------------
    Chad Markle
    Senior Director of IT Unified Communications
    ------------------------------