Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Get List of Queue Members

    Posted 04-14-2025 11:24

    Hello,

    I am wanting to generate a list of members of a queue. Here's my output:

    {
      "type": "object",
      "properties": {
        "Members": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
    And my Response:
    {
      "translationMap": {
        "Members": "$..entities..name"
      },
      "translationMapDefaults": {
        "Members": "[]"
      },
      "successTemplate": "{\n   \"Members\": ${Members}\n}"
    }
    The issue I'm running into is it's going through every single "name" in the response. For example when running /api/v2/routing/queues/{queueId}/members I get the following response:

      "entities": [

        {
          "id": "id1",
          "name": "Name1",
          "user": {
            "id": "id1",
            "name": "Name2",
            "division": {
              "id": "id",
              "name": "Name3",
              "selfUri": "/api/v2/authorization/divisions/id"
            },
            "chat": {
              "jabberId": "id@orgspan.com"
            }

    This will return Name1, Name2, and Name3, but I am just wanting to return Name1. I figure it has something to do with my translation map, I'm just not sure what.

    Thank you,


    #DataActions

    ------------------------------
    Tristen Schwarzenberger
    ------------------------------


  • 2.  RE: Get List of Queue Members
    Best Answer

    Posted 04-14-2025 11:35

    Hello,

    You can use the following to select the "name" attribute at the root of the entity object:

    "translationMap": {
        "Members": "$.entities[*].name"
      }

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 3.  RE: Get List of Queue Members

    Posted 04-14-2025 11:37
    Edited by Tristen Schwarzenberger 04-14-2025 11:37

    I knew it was something simple! Worked perfectly. Thank you.



    ------------------------------
    Tristen Schwarzenberger
    IT Engineer
    ------------------------------