Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta data's parameters are not received on server side #197

Closed
attriaman2520 opened this issue Apr 21, 2021 · 9 comments
Closed

Meta data's parameters are not received on server side #197

attriaman2520 opened this issue Apr 21, 2021 · 9 comments

Comments

@attriaman2520
Copy link

attriaman2520 commented Apr 21, 2021

When i send a message i send a parameter in metadata. Here is log which get printed when i send a message :

Sending message to server: {
"applicationId": "174afd6c613bbb5be0bbd725cafbe88",
"attDownloadInProgress": false,
"canceled": false,
"clientGroupId": "info@usa2georgia.com_523659",
"connected": false,
"contactIds": "",
"contentType": 0,
"createdAtTime": 1618817104202,
"delivered": false,
"deviceKey": "235cc17d-d712-4ad2-97d5-d4bc29753274",
"groupId": 57925473,
"hidden": false,
"key": "212a5201-f473-4f05-9322-925342e92380",
"message": "hello. testing again",
"metadata": {
"userId": "66b3d32cd58a51a54d35a3547cc7e5e0"
},

"read": true,
"replyMessage": 0,
"sendToDevice": false,
"sent": true,
"sentMessageTimeAtServer": 0,
"sentToServer": true,
"shared": false,
"source": 2,
"status": 1,
"storeOnDevice": true,
"type": 5,
"userKey": "974bb53b-3768-43f0-9cc0-24f5e9a6fc9e"
}

But our web guy is unable to get "userId" under metadata on his side. Here is the request he is getting using "dialogflow". Can you help us with this?

{"responseId":"55eb9d3d-1311-4c7d-8c65-e9271be3a59c-d74139ee","queryResult":{"queryText":"u10d2u10d0u10dbu10d0u10e0u10efu10ddu10d1u10d0","parameters":[],"allRequiredParamsPresent":true,"fulfillmentMessages":[{"payload":{"metadata":{"payload":[{"message":"u10d8u10dcu10e4u10ddu10e0u10dbu10d0u10eau10d8u10d0 u10d0u10dbu10d0u10dcu10d0u10d7u10d8u10e1 u10e8u10d4u10e1u10d0u10eeu10d4u10d1","title":"u10d8u10dcu10e4u10ddu10e0u10dbu10d0u10eau10d8u10d0 u10d0u10dbu10d0u10dcu10d0u10d7u10d8u10e1 u10e8u10d4u10e1u10d0u10eeu10d4u10d1"},{"message":"u10d6u10ddu10d2u10d0u10d3u10d8 u10d8u10dcu10e4u10ddu10e0u10dbu10d0u10eau10d8u10d0","title":"u10d6u10ddu10d2u10d0u10d3u10d8 u10d8u10dcu10e4u10ddu10e0u10dbu10d0u10eau10d8u10d0"}],"contentType":"300","templateId":"6"},"message":"u10dbu10ddu10d2u10d4u10e1u10d0u10dau10dbu10d4u10d1u10d8 $firstname, u10dbu10d4 USA2GEORGIA-u10e1 u10d1u10ddu10e2u10d8 u10d5u10d0u10e0. u10d8u10dcu10e4u10ddu10e0u10dbu10d0u10eau10d8u10d8u10e1 u10dbu10d8u10e1u10d0u10e6u10d4u10d1u10d0u10d3, u10d2u10d7u10eeu10ddu10d5u10d7, u10d0u10d8u10e0u10e9u10d8u10ddu10d7:","platform":"kommunicate"}}],"outputContexts":[{"name":"projects/usa2bot-emqd/agent/sessions/57925473/contexts/actions-followup","lifespanCount":2},{"name":"projects/usa2bot-emqd/agent/sessions/57925473/contexts/system_counters","lifespanCount":1,"parameters":{"no-input":0,"no-match":0}}],"intent":{"name":"projects/usa2bot-emqd/agent/intents/3bf1bb94-7000-4122-a3fc-78efcee19f63","displayName":"actions"},"intentDetectionConfidence":1,"languageCode":"en"},"originalDetectIntentRequest":{"payload":{"messageSource":"2","botId":"usa2georgia-bot-ahpos","attachments":[],"groupId":"57925473","applicationId":"174afd6c613bbb5be0bbd725cafbe88"}},"session":"projects/usa2bot-emqd/agent/sessions/57925473"}
white_check_mark
eyes
raised_hands

@devashishmamgain
Copy link
Contributor

we will check if there is any issue with sending message metadata to Dialogflow.

In the mean time, if you are using it for userId, please try this approach https://docs.kommunicate.io/docs/bot-dialogflow-integration#pass-custom-data-to-bot-platform
As userId will belong to a conversation, so passing it in chat context will be better

@attriaman2520
Copy link
Author

Devash did you check on your end that Metadata pass from Andriod app to Dialogflow? I also tried Kommunicate.updateChatContext(activity,messageMetaData) it did not work. also this method is deprecated now.

@reytum
Copy link
Contributor

reytum commented Apr 26, 2021

@attriaman2520
Use the new method as below:

       Map<String, String> stringStringMap = new HashMap<>();
        stringStringMap.put("Test", "Value");
        KmSettings.updateChatContext(this, stringStringMap);

The data should be published as below:

** Posting data **: {
      "attDownloadInProgress": false,
      "canceled": false,
      "clientGroupId": "58096926",
      "connected": false,
      "contactIds": "",
      "contentType": 0,
      "createdAtTime": 1619422480330,
      "delivered": false,
      "deviceKey": "66195f65-6653-4451-9073-4b86245fa2f5",
      "groupId": 58096926,
      "hidden": false,
      "key": "5d961f0a-651d-4c3e-af2f-faf440c87c17",
      "message": "Hey",
      "metadata": {
        "KM_CHAT_CONTEXT": "{\n  \"Test\": \"Value\"\n}"
      },
      "read": true,
      "replyMessage": 0,
      "sendToDevice": false,
      "sent": true,
      "sentMessageTimeAtServer": 0,
      "sentToServer": true,
      "shared": false,
      "source": 2,
      "status": 1,
      "storeOnDevice": true,
      "type": 5,
      "userKey": "3eee3066-57fa-4195-8549-ea218b91c277"
    }

@attriaman2520
Copy link
Author

Thanks @reytum . It worked in case of Android. We could not find this method incase of IOS. Could you help with that?

@Samir1810
Copy link

@attriaman2520
Copy link
Author

@Samir1810 thanks that worked

@attriaman2520
Copy link
Author

@Samir1810 Could you tell how to enable delete conversation in iOS?

@Samir1810
Copy link

@attriaman2520 Are you looking to delete the user chat widget end conversation or the dashboard?

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

A friendly reminder that this issue had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants