Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  create data action using /api/v2/conversations/{conversationId} to use the outputs a workflow

    Posted 23 days ago

    hello

    we have a problem creating a data action using /api/v2/conversations/{conversationId}

    we have the conversationId as input.

    we need as output 2 participant data from script. we have this data at "participants.attributes.NumLocalizador" and "participants.attributes.HotelReserva".

    if we see at the response all the json, we can see this values, but we need them in a workflow (to send them to Salesforce) as variables, and we can take them.

    at the response we have tried to do the next one without a good solution:


    {
      "translationMap": {
        "Localizador":  "$.participants[0].attributes.NumLocalizador",
        "Hotel":"$.participants[0].attributes.HotelReserva""
        
      },
      "translationMapDefaults": {},
       "successTemplate": {"${NumLocalizador}": "${Localizador}","${HotelReserva}": "${Hotel}"     
         
       }
    }

    where ${NumLocalizador} and ${HotelReserva} are our 2 outputs at contracts.

    what is wrong? we do not know how to create it.

    thank you


    #API/Integrations

    ------------------------------
    Micaela Garcia
    Weber Solutions SL.
    ------------------------------


  • 2.  RE: create data action using /api/v2/conversations/{conversationId} to use the outputs a workflow

    Posted 23 days ago

    Hello Micaela,

    It depends where the Participant Data is set.

    If it's set in the incoming flow in Architect you should be able to get them using the Get Conversation Data action in Architect leaving Participant ID empty.

    If they are set by another participant you need to modify you translationMap to look through all participants, something like

    "translationMap": {
        "Localizador": "$.participants[*].attributes.NumLocalizador",
        "Hotel":"$.participants[*].attributes.HotelReserva""
    }



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 3.  RE: create data action using /api/v2/conversations/{conversationId} to use the outputs a workflow

    Posted 22 days ago

    Hello Jan

    we have here a part of the json:


    {
      "participants.calls.other.nameRaw": [
        [
          ""
        ],
        [
          "Sercotel Hoteles"
        ]
      ],
      "participants.attributes.NumLocalizador": [
        "test localizador mica",
        null
      ],
      "participants.wrapup.name": [
        "21 NP Test",
        null
      ],
      "participants.name": [
        "Micaela Garcia",
        "Mobile Number, Spain"
      ],

      "participants.attributes.HotelReserva": [
        "Hotel mica",
        null
      ],

      "selfUri": "/api/v2/conversations/775b******e24df"

    }

    so we donot know where the participant data is set and how much are there.

    thank you



    ------------------------------
    Micaela Garcia
    Weber Solutions SL.
    ------------------------------



  • 4.  RE: create data action using /api/v2/conversations/{conversationId} to use the outputs a workflow

    GENESYS
    Posted 9 days ago

    Hello Micaela, 

    Did you find a solution for this? 

    Cheers,



    ------------------------------
    Cam
    Online Community Manager/Moderator
    ------------------------------



  • 5.  RE: create data action using /api/v2/conversations/{conversationId} to use the outputs a workflow
    Best Answer

    Posted 6 days ago
    Edited by Jason Kleitz 5 days ago

    There is a syntax error on the success template.

    Try something like this:

    {
      "translationMap": {
        "Localizador":  "$.participants[0].attributes.NumLocalizador",
        "Hotel":" $.participants[0].attributes.HotelReserva""
        
      },
      "translationMapDefaults": {},
       "successTemplate":  "{\"Localizador\": ${Localizador},\"Hotel\": ${Hotel}}" 
    }



    ------------------------------
    Paulo Mesquita
    Solutions Consultant
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources