Genesys Cloud CX

 View Only
Discussion Thread View
  • 1.  CX as Code

    Posted 05-22-2022 12:47
    Hello all,
    I am trying to use "CX as Code" for administering and managing the customer's environment.
    Sometimes it's very difficult to find some "help" information.
    For example, I want to use the GC for adding and removing users to the group.
    In the "help" I found the command:
    gc.exe groups members add 'groupID' -f 'filename.JSON'
    PS D:\TMP> gc.exe groups members add -h
    Add members
    Usage:
    gc groups members add [groupId] [flags]
    Flags:
    -f, --file string File name containing the JSON body
    -h, --help help for add
    Global Flags:
    --clientid string clientId override
    --clientsecret string clientSecret override
    --environment string environment override. E.g. mypurecloud.com.au or ap-southeast-2
    -i, --indicateprogress Trace progress indicators to stderr
    -p, --profile string Name of the profile to use for configuring the cli (default "DEFAULT")
    Operation:
    POST /api/v2/groups/{groupId}/members
    Note: The 'version' value from the command input will be ignored and the latest version value will be retrieved from the API instead
    Operation:
    POST /api/v2/groups/{groupId}/members
    Documentation:
    https://developer.genesys.cloud/api/rest/v2/groups/#post-api-v2-groups--groupId--members
    PS D:\TMP>

    But I can't find the format of the "JSON body" file.

    Maybe somebody knows where it's possible to find such information?

    I tried to get the "members list" from the other group:
    Something like this:
    {
    "entities": [
    {
    "id": "773cfee8-33e6-4e05-be9a-0f0d2774b38b",
    "name": "Roei Yona",
    "department": "אפליקציות",
    "email": "roei.yona@strauss-water.com",
    "state": "active",
    "title": "מנהל/ת מערכות טלפוניה",
    "username": "roei.yona@strauss-water.com",
    "version": 49,
    "acdAutoAnswer": false,
    "selfUri": "/api/v2/users/773cfee8-33e6-4e05-be9a-0f0d2774b38b"
    }
    ]
    }

    But I am getting the error:
    {
    "message": "Validation error(s): [API Exception 400:\"Bad Request\" : Illegal value for field: individuals, Reason: Missing data for required field.]",
    "code": "bad.request",
    "status": 400,
    "contextId": "9169549b-faba-4098-82f9-a860f7424753",
    "details": [],
    "errors": []
    }
    Where do I need to add this field and what are the possible values?












    #PlatformAdministration
    #Unsure/Other

    ------------------------------
    Best regards,

    Yvgeni Liberman
    ITNAV-Pro Ltd.
    ------------------------------


  • 2.  RE: CX as Code

    GENESYS
    Posted 05-23-2022 14:09

    Hi Yvgeni,

    Thanks for reaching out.  What you are showing up is not our CX as Code tool but rather our CLI.  Our CLI is generated directly off the API.  Could you validate the version of the CLI you are running and whether it is the newest version.

    Thanks,

        John Carnell



    ------------------------------
    John Carnell
    Genesys - Employees
    ------------------------------



  • 3.  RE: CX as Code

    Posted 05-24-2022 02:25
    Dear @John Carnell
    Many thanks for Your respond
    ​We are using the:
    PS D:\TMP> gc.exe version
    15.0.0
    PS D:\TMP>​
    As I understand, it's the latest version?



    ------------------------------
    Best regards,

    Yvgeni Liberman
    ITNAV-Pro Ltd.
    ------------------------------



  • 4.  RE: CX as Code

    GENESYS
    Posted 05-24-2022 10:32

    Hi Yvgeni,

    Weird I am showing the latest version of our CLI is version 37.0.0.  Please download the windows CLI from the DevCenter and double-check the version you are getting off of it?  I do not see that, so I want to make sure we don't have something unusual with our CDN.

    Thanks,
        John



    ------------------------------
    John Carnell
    Genesys - Employees
    ------------------------------



  • 5.  RE: CX as Code

    Posted 05-26-2022 02:26
    John,
    You are right, it was not the latest version.
    I downloaded and installed the latest version.
    But I still have the same "problem" (question) about JSON format



    ------------------------------
    Best regards,

    Yvgeni Liberman
    ITNAV-Pro Ltd.
    ------------------------------