Genesys Cloud - Main

 View Only

Sign Up

  • 1.  Data Action to gather Participant data - Help Needed

    Posted 17 hours ago

    I am running a Workflow in Genesys and I need to pull a field in the participant data, specifically the SF_URLPop field, which in our case happens to be the Salesforce LeadID
    I am running an API - GET /api/v2/conversations/{conversationId} and it gathers all the data, but I only need the data in against SF_URLPop 
    There is 100s of lines outputted when I run the API above, but the below only pertains to the attributes that are part of the Participant data
    How can I get the API to only pull the SF_URLPop? What is added to the translationMap and successTemplate in order to get it to work
    Any help would be useful.

    Thanks

    attributes: {
    summary: "Customer requested sales assistance for a team account setup",
    Lastname: "Jones",
    SF_URLPop: "000000000001234",
    locale: "en-us",
    intent: "sales",
    Firstname: "Tom",
    Recording: "Enabled"
    },

    #API/Integrations

    ------------------------------
    Alastair Pitt
    Docusign, Inc.
    ------------------------------


  • 2.  RE: Data Action to gather Participant data - Help Needed
    Best Answer

    Posted 17 hours ago
    Edited by Luiz Rosa 14 hours ago

    Hi Alastair Pitt,

    I believe this is what you're looking for.

    You can use a custom Data Action that calls
    GET /api/v2/conversations/{conversationId}
    and then use the translationMap and successTemplate to extract only the participant attribute you need.

    For example, this Data Action returns all attributes from the customer participant:

    {
      "name": "Teste Luiz",
      "integrationType": "purecloud-data-actions",
      "actionType": "custom",
      "config": {
        "request": {
          "requestUrlTemplate": "/api/v2/conversations/${input.conversationId}",
          "requestType": "GET",
          "headers": {},
          "requestTemplate": "${input.rawRequest}"
        },
        "response": {
          "translationMap": {
          "atributos": "$.participants[?(@.purpose == 'customer')].attributes"
          },
          "translationMapDefaults": {
            "atributos": "\"Não encontrado\""
          },
          "successTemplate": "{\"atributos\":${atributos}}"
        }
      },
      "contract": {
        "input": {
          "inputSchema": {
            "type": "object",
            "properties": {
              "conversationId": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        },
        "output": {
          "successSchema": {
            "type": "object",
            "properties": {
              "atributos": {
                "type": "array",
                "items": {
                  "title": "Item 1",
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {}
                }
              }
            },
            "additionalProperties": true
          }
        }
      },
      "secure": false
    }

    If you only want the SF_URLPop field (in your case the Salesforce LeadID), you can narrow it down like this:

    "response": {
      "translationMap": {
        "sfUrlPop": "$.participants[?(@.purpose == 'customer')].attributes.SF_URLPop"
      },
      "translationMapDefaults": {
        "sfUrlPop": "\"\""
      },
      "successTemplate": "{\"SF_URLPop\": ${sfUrlPop}}"
    }

    This way, the Data Action output will only contain the SF_URLPop value you need, instead of the full conversation payload.
    ------------------------------
    Luiz Rosa
    Full stack developer
    ------------------------------



  • 3.  RE: Data Action to gather Participant data - Help Needed

    Posted 15 hours ago
    Edited by Alastair Pitt 15 hours ago

    Thank you @Luiz Rosa for your quick reply, much appreciated.

    To confirm,  I have the below as the Input

    {
    "type": "object",
    "properties": {
    "conversationId": {
    "type": "string"
    }
    }
    }

    And this as the Output

    {
    "SF_URLPop": {
    "type": "string",
    "description": "The value of the SF_URLPop attribute for the customer participant"
    }
    }
    And when I add in the response you mentioned above, I get this error 

    "message": "Action failed validation. Errors: [JSON failed schema validation of contract.output.successSchema for the following reasons: the following keywords are unknown and will be ignored: [SF_URLPop]]",
    "code": "BAD_REQUEST",

    Could it because the SF_URLPop is not in commas '' " as you can see below or is it because the Name is not as mentioned ?

    attributes: {
    summary: "Customer requested sales assistance for a team account setup",
    Lastname: "Jones",
    SF_URLPop: "000000000001234",
    locale: "en-us",
    intent: "sales",
    Firstname: "Tom",
    Recording: "Enabled"
    },

    Thanks



    ------------------------------
    Alastair Pitt
    Docusign, Inc.
    ------------------------------



  • 4.  RE: Data Action to gather Participant data - Help Needed

    Posted 14 hours ago

    Hi Alastair Pitt. you need to adjust the translation map. A simple path is this one, keeping in mind that the conversation participant we're pulling from is the customer. If it's a different participant, just change the translation accordingly:

    New example:

    {
    "name": "Teste Luiz",
    "integrationType": "purecloud-data-actions",
    "actionType": "custom",
    "config": {
    "request": {
    "requestUrlTemplate": "/api/v2/conversations/${input.conversationId}",
    "requestType": "GET",
    "headers": {},
    "requestTemplate": "${input.rawRequest}"
    },
    "response": {
    "translationMap": {
    "atributos": "$.participants[?(@.purpose == 'customer')].attributes"
    },
    "translationMapDefaults": {
    "atributos": """"
    },
    "successTemplate": "{"atributos":${atributos}}"
    }
    },
    "contract": {
    "input": {
    "inputSchema": {
    "type": "object",
    "properties": {
    "conversationId": {
    "type": "string"
    }
    },
    "additionalProperties": true
    }
    },
    "output": {
    "successSchema": {
    "type": "object",
    "properties": {
    "atributos": {
    "type": "array",
    "items": {
    "title": "Item 1",
    "type": "object",
    "additionalProperties": true,
    "properties": {
    "SF_URLPop": {
    "type": "string"
    }
    }
    }
    }
    },
    "additionalProperties": true
    }
    }
    },
    "secure": false
    }

    I hope this helps.



    ------------------------------
    Luiz Rosa
    Full stack developer
    ------------------------------



  • 5.  RE: Data Action to gather Participant data - Help Needed

    Posted 13 hours ago

    @Luiz Rosa
    Thanks for the below. I really am flying blind here. Do you have any information around understanding how to extract the right data as its all new to me.
    I am untrained in the formatting used, so any help would be appreciated 



    ------------------------------
    Alastair Pitt
    Docusign, Inc.
    ------------------------------



  • 6.  RE: Data Action to gather Participant data - Help Needed

    Posted 13 hours ago
    Edited by Luiz Rosa 13 hours ago

    Hi Alastair Pitt,

    This JSON is a Genesys Cloud Custom Data Action.
    You can import it directly into your org by creating a new Data Action under Integrations → Actions, choosing Custom, and then pasting this content (or using a file named Test.custom.json).

    In short:
    • The "request" section defines how we call the endpoint /api/v2/conversations/{conversationId}.
    • The "translationMap" extracts the customer participant's attributes using JSONPath.
    • The "successTemplate" formats the output so Architect receives it in a clean structure.

    Once imported, you can call this Data Action from your Architect flow and it will return the conversation's customer attributes.

    Here are some guides that may help you:

    About Data Actions:
    https://help.mypurecloud.com/articles/about-the-data-actions-integrations/

    How to create a Data Action:
    https://help.mypurecloud.com/articles/create-custom-action-integrations/

    Response configuration:
    https://help.mypurecloud.com/articles/response-configuration-data-actions/

    Regarding Genesys APIs:

    Here you can find an explanation of conversations and their APIs:
    https://developer.genesys.cloud/routing/conversations/



    ------------------------------
    Luiz Rosa
    Full stack developer
    ------------------------------



  • 7.  RE: Data Action to gather Participant data - Help Needed

    Posted 13 hours ago

    Thank you so much @Luiz Rosa, this is most helpful. I will go over everything and revisit my config. 
    Appreciate the help



    ------------------------------
    Alastair Pitt
    Docusign, Inc.
    ------------------------------