Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  API response with data array

    Posted 05-15-2025 12:21

    Hello,

    I am currently working on an automation project.

     

    In short, I am looking to automatically update a gamification profile members based on queues. In my limited knowledge of API's, I thought this would be easiest to use the below API to get the names of everyone assigned to the queue and then use a different API to add all the names to the gamification profile. I am currently running into an issue trying to get all the id's from everyone in the queue. I am pretty sure the issue is with my translation map/success template but hopefully someone can assist. (I am putting all my info incase its not in the translation map/success template)

     

    Input contract:

    {

      "type": "object",

      "required": [

        "Queue_ID"

      ],

      "properties": {

        "Queue_ID": {

          "type": "string"

        }

      }

    }

     

     

    Output Contract:

    {

      "type": "object",

      "properties": {

        "name": {

          "type": "string"

        },

        "id": {

          "type": "string"

        }

      }

    }

     

    Configuration:

    Response:

     

    {

      "translationMap": {

        "id": "$.entities.id"

      },

      "translationMapDefaults": {},

      "successTemplate": "{\n   \"id\": ${id}\n}"

    }


    #API/Integrations

    ------------------------------
    Connor Maxwell
    -
    ------------------------------


  • 2.  RE: API response with data array

    Posted 05-15-2025 14:27

    Hello Connor,

    Thank you for that write up. I have moved your question to the Genesys Cloud - Developer Community. Hopefully one of the experts there will be able to assist you with this.



    ------------------------------
    Jason Kleitz
    Online Community Manager/Moderator
    ------------------------------



  • 3.  RE: API response with data array
    Best Answer

    Posted 05-15-2025 16:46

    Hi Connor,

    Use following output contract

    {
      "type": "object",
      "properties": {
        "id": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }

    And below translationMap

    "id": "$.entities[*].id"

    That should get you going. 

    Cheers

    Zubair



    ------------------------------
    Cheers
    Zubair
    ------------------------------



  • 4.  RE: API response with data array

    Posted 05-15-2025 18:49

    That did it! Thank you so much Zubair!



    ------------------------------
    Connor Maxwell
    -
    ------------------------------