How fast does does the conversation message API updates?

Hi all,

I am trying to get the lastest Textbody of the message keyed by a user over Whatsapp and then save the textbody as a variable in Architect in the fastest way possible.

My use case is something like:-
Bot: "Describe your problem"
User: "My printer ran out of toner"
Bot: "Problem Description: My printer ran out of toner"

I just need the textbody word for word and read it out back to the user in the next line.

I have found out that I can get the latest Message by these 2 APIs

/api/v2/conversations/messages/{conversationId}
to find the all the messages related to the conversation ID

/api/v2/conversations/messages/{messageId}/details
Use this to extract the textbody

However, the current set up takes too long to reflect the latest message, I have tested and it takes 30 seconds before the latest messageID is the one that the user types, anything less than this will be the second latest message.

Any other method to get the latest text that the user type instantaneously?

I also tried the architect variable, "message.message.body" - this only works for the first message typed when initiating the session, it does not update in the middle of a whatsapp session.

Hello,

What you are describing looks like a bot use case.
If you are trying to implement this using only an Architect Inbound Chat/Message flow, this will not work (not meant for this).
You will need to leverage a bot integration to achieve this: About bots - Genesys Cloud Resource Center

Regards,

Bot has already been implemented (dialogflow)

But the customer's requirement is to get it word for word what the customer typed. With dialogflow, I have to anticipate what the customer has to type (using parameters and outputs) to capture the text which is impossible since this is free text. How do I capture textbody using bot?

Hello,

I don't have much practice with DialogFlow (and didn't have for a while).
But could agent.query (in DF fulfilment) provide such info? Found this post/page

Regards,

Hi @Jerome.Saint-Marc

Thanks so much for the reference. I managed to capture the query and then set it as parameter using

    agent.setContext({ name: 'genesys-output', lifespan: 1, parameters: { user_Input: userInput }});

where userInput = agent.query

But I am not getting it back in GC's architect.

This is a raw file of one of the message

{
  "responseId": "6ecb778a-f093-4fd7-a13b-185a76cdf7e4-cc68fdcf",
  "queryResult": {
    "queryText": "collect query",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            "This Collect Query Intent"
          ]
        }
      },
      {
        "text": {
          "text": [
            "You said: \"collect query\""
          ]
        }
      }
    ],
    "outputContexts": [
      {
        "name": "projects/gc-ricoh-my/locations/global/agent/sessions/480cf655-25ef-ed01-057f-f5a8f490065d/contexts/genesys-output",
        "lifespanCount": 1,
        "parameters": {
          "user_Input": "collect query"
        }
      },
      {
        "name": "projects/gc-ricoh-my/locations/global/agent/sessions/480cf655-25ef-ed01-057f-f5a8f490065d/contexts/collectquery-followup",
        "lifespanCount": 2
      }
    ],
    "intent": {
      "name": "projects/gc-ricoh-my/locations/global/agent/intents/588e93c7-e14f-40e6-8e2c-cc2ba4c90864",
      "displayName": "CollectQuery"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 2398
    },
    "languageCode": "en",
    "sentimentAnalysisResult": {
      "queryTextSentiment": {}
    }
  },
  "webhookStatus": {
    "message": "Webhook execution successful"
  },
  "agentId": "561dbd4a-43e0-4d7b-a315-18fa7aa35134"
}

Where the one I managed to set is in

      {
        "name": "projects/gc-ricoh-my/locations/global/agent/sessions/480cf655-25ef-ed01-057f-f5a8f490065d/contexts/genesys-output",
        "lifespanCount": 1,
        "parameters": {
          "user_Input": "collect query"
        }
      }

I think the one that genesys-output takes from is the "parameters" field under "queryResults". Any way for genesys to capture the parameter field i need?

referring to > Call Dialogflow Bot action - Genesys Cloud Resource Center

I think that what you are looking for are the "Session Variables" (output) in the Call Dialogflow Bot action.
See section on Session Variables here.

Regards,

Solved!

I just had to initialise the parameters with an empty value one intent prior.

Thanks Jerome!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.