Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: messages in message...












0















I built a bot using Dialogflow and connected it to a local webhook (now accessing it through ngrok). I am able to receive the response from Dialogflow but I am unable to replay to it. I followed the JSON structure as shown here - Test response from webhook. But I am getting the following error in Dialogflow.




Webhook call failed. Error: Failed to parse webhook JSON response:
Cannot find field: messages in message
google.cloud.dialogflow.v2.Intent.Message.




Following is the reply that I sent to Dialogflow -



{
"messages":[
{
"speech":"Text response",
"type":0
}
]
}


Please tell me what should be the exact format of the reply that I should send to Dialogflow.










share|improve this question



























    0















    I built a bot using Dialogflow and connected it to a local webhook (now accessing it through ngrok). I am able to receive the response from Dialogflow but I am unable to replay to it. I followed the JSON structure as shown here - Test response from webhook. But I am getting the following error in Dialogflow.




    Webhook call failed. Error: Failed to parse webhook JSON response:
    Cannot find field: messages in message
    google.cloud.dialogflow.v2.Intent.Message.




    Following is the reply that I sent to Dialogflow -



    {
    "messages":[
    {
    "speech":"Text response",
    "type":0
    }
    ]
    }


    Please tell me what should be the exact format of the reply that I should send to Dialogflow.










    share|improve this question

























      0












      0








      0


      1






      I built a bot using Dialogflow and connected it to a local webhook (now accessing it through ngrok). I am able to receive the response from Dialogflow but I am unable to replay to it. I followed the JSON structure as shown here - Test response from webhook. But I am getting the following error in Dialogflow.




      Webhook call failed. Error: Failed to parse webhook JSON response:
      Cannot find field: messages in message
      google.cloud.dialogflow.v2.Intent.Message.




      Following is the reply that I sent to Dialogflow -



      {
      "messages":[
      {
      "speech":"Text response",
      "type":0
      }
      ]
      }


      Please tell me what should be the exact format of the reply that I should send to Dialogflow.










      share|improve this question














      I built a bot using Dialogflow and connected it to a local webhook (now accessing it through ngrok). I am able to receive the response from Dialogflow but I am unable to replay to it. I followed the JSON structure as shown here - Test response from webhook. But I am getting the following error in Dialogflow.




      Webhook call failed. Error: Failed to parse webhook JSON response:
      Cannot find field: messages in message
      google.cloud.dialogflow.v2.Intent.Message.




      Following is the reply that I sent to Dialogflow -



      {
      "messages":[
      {
      "speech":"Text response",
      "type":0
      }
      ]
      }


      Please tell me what should be the exact format of the reply that I should send to Dialogflow.







      webhooks dialogflow






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 17 '18 at 11:47









      SunilSunil

      4512




      4512
























          4 Answers
          4






          active

          oldest

          votes


















          1














          From v1 to v2, the response object almost change completely. For just simple text, you can use like:



          {
          "fulfillmentText": "Text response",
          "fulfillmentMessages": [
          {
          "text": {
          "text": ["Text response"]
          }
          }
          ],
          "source": "<Text response>"
          }





          share|improve this answer































            1














            I faced same issue,resolved using below json on dialogflow :



            enter image description here



            I made a simple node program which accepts a post response and returns json of the format accepted by Dialogflow.You may send your request in any way you like. check on Fulfillment status tab :



            enter image description here






            share|improve this answer

































              0














              Messages alone is not sufficient. Refer to Dialogflow V2 webhook fulfillment documentation for complete list of parameters expected and format of JSON.



              Are you sure you are using V2 of the DialogFlow APIs?






              share|improve this answer
























              • Vinay P Thanks for responding. I am not using their SDK. I am receiving the POST request from Dialogflow in a flask app and parsing it. I am then sending a custom reply from flask app. I Used the link that you gave but still not working. Can you tell me how to use this - dialogflow.com/docs/reference/api-v2/rest/v2beta1/…

                – Sunil
                May 17 '18 at 12:50











              • This another link says that all the values are optional.

                – Sunil
                May 17 '18 at 12:53













              • @sunil I have done similar implementation using V1, it is not sufficient to send only the fields you have considered. And again the messages error would I guess appear only in V1, because V2 doesnt seem to have that field(I can be wrong with V2 as I havent worked on that). And I have not migrated to V2 as it is still not production ready.

                – Vinay P
                May 18 '18 at 5:24













              • Thank you @Vinay for sticking with me. I changed the agent from V2 to V1 and I changed the reply from webhook accordingly. But the question still remains - What is the exact format of reply from webhook that V2 can understand?

                – Sunil
                May 18 '18 at 6:45











              • I would not suggest anything in V2 as I haven't moved to that yet. In V1 displaytext is one field could be needed.

                – Vinay P
                May 18 '18 at 6:58



















              0














              The field messageswas renamed/refactored to fulfillmentMessages - "can not find" means that it is not a property in the definition.
              This is some comparable result accepted by v2:



              {
              "fulfillmentText": "response text",
              "fulfillmentMessages": [{"simpleResponses": {"simpleResponses": [ {
              "textToSpeech": "response text",
              "displayText": "response text"
              }]}}]
              }





              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50390670%2fwebhook-call-failed-error-failed-to-parse-webhook-json-response-cannot-find-f%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                1














                From v1 to v2, the response object almost change completely. For just simple text, you can use like:



                {
                "fulfillmentText": "Text response",
                "fulfillmentMessages": [
                {
                "text": {
                "text": ["Text response"]
                }
                }
                ],
                "source": "<Text response>"
                }





                share|improve this answer




























                  1














                  From v1 to v2, the response object almost change completely. For just simple text, you can use like:



                  {
                  "fulfillmentText": "Text response",
                  "fulfillmentMessages": [
                  {
                  "text": {
                  "text": ["Text response"]
                  }
                  }
                  ],
                  "source": "<Text response>"
                  }





                  share|improve this answer


























                    1












                    1








                    1







                    From v1 to v2, the response object almost change completely. For just simple text, you can use like:



                    {
                    "fulfillmentText": "Text response",
                    "fulfillmentMessages": [
                    {
                    "text": {
                    "text": ["Text response"]
                    }
                    }
                    ],
                    "source": "<Text response>"
                    }





                    share|improve this answer













                    From v1 to v2, the response object almost change completely. For just simple text, you can use like:



                    {
                    "fulfillmentText": "Text response",
                    "fulfillmentMessages": [
                    {
                    "text": {
                    "text": ["Text response"]
                    }
                    }
                    ],
                    "source": "<Text response>"
                    }






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 24 '18 at 23:14









                    techyauratechyaura

                    2,14011220




                    2,14011220

























                        1














                        I faced same issue,resolved using below json on dialogflow :



                        enter image description here



                        I made a simple node program which accepts a post response and returns json of the format accepted by Dialogflow.You may send your request in any way you like. check on Fulfillment status tab :



                        enter image description here






                        share|improve this answer






























                          1














                          I faced same issue,resolved using below json on dialogflow :



                          enter image description here



                          I made a simple node program which accepts a post response and returns json of the format accepted by Dialogflow.You may send your request in any way you like. check on Fulfillment status tab :



                          enter image description here






                          share|improve this answer




























                            1












                            1








                            1







                            I faced same issue,resolved using below json on dialogflow :



                            enter image description here



                            I made a simple node program which accepts a post response and returns json of the format accepted by Dialogflow.You may send your request in any way you like. check on Fulfillment status tab :



                            enter image description here






                            share|improve this answer















                            I faced same issue,resolved using below json on dialogflow :



                            enter image description here



                            I made a simple node program which accepts a post response and returns json of the format accepted by Dialogflow.You may send your request in any way you like. check on Fulfillment status tab :



                            enter image description here







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 30 '18 at 5:27

























                            answered Nov 29 '18 at 19:12









                            Shashank BodkheShashank Bodkhe

                            948




                            948























                                0














                                Messages alone is not sufficient. Refer to Dialogflow V2 webhook fulfillment documentation for complete list of parameters expected and format of JSON.



                                Are you sure you are using V2 of the DialogFlow APIs?






                                share|improve this answer
























                                • Vinay P Thanks for responding. I am not using their SDK. I am receiving the POST request from Dialogflow in a flask app and parsing it. I am then sending a custom reply from flask app. I Used the link that you gave but still not working. Can you tell me how to use this - dialogflow.com/docs/reference/api-v2/rest/v2beta1/…

                                  – Sunil
                                  May 17 '18 at 12:50











                                • This another link says that all the values are optional.

                                  – Sunil
                                  May 17 '18 at 12:53













                                • @sunil I have done similar implementation using V1, it is not sufficient to send only the fields you have considered. And again the messages error would I guess appear only in V1, because V2 doesnt seem to have that field(I can be wrong with V2 as I havent worked on that). And I have not migrated to V2 as it is still not production ready.

                                  – Vinay P
                                  May 18 '18 at 5:24













                                • Thank you @Vinay for sticking with me. I changed the agent from V2 to V1 and I changed the reply from webhook accordingly. But the question still remains - What is the exact format of reply from webhook that V2 can understand?

                                  – Sunil
                                  May 18 '18 at 6:45











                                • I would not suggest anything in V2 as I haven't moved to that yet. In V1 displaytext is one field could be needed.

                                  – Vinay P
                                  May 18 '18 at 6:58
















                                0














                                Messages alone is not sufficient. Refer to Dialogflow V2 webhook fulfillment documentation for complete list of parameters expected and format of JSON.



                                Are you sure you are using V2 of the DialogFlow APIs?






                                share|improve this answer
























                                • Vinay P Thanks for responding. I am not using their SDK. I am receiving the POST request from Dialogflow in a flask app and parsing it. I am then sending a custom reply from flask app. I Used the link that you gave but still not working. Can you tell me how to use this - dialogflow.com/docs/reference/api-v2/rest/v2beta1/…

                                  – Sunil
                                  May 17 '18 at 12:50











                                • This another link says that all the values are optional.

                                  – Sunil
                                  May 17 '18 at 12:53













                                • @sunil I have done similar implementation using V1, it is not sufficient to send only the fields you have considered. And again the messages error would I guess appear only in V1, because V2 doesnt seem to have that field(I can be wrong with V2 as I havent worked on that). And I have not migrated to V2 as it is still not production ready.

                                  – Vinay P
                                  May 18 '18 at 5:24













                                • Thank you @Vinay for sticking with me. I changed the agent from V2 to V1 and I changed the reply from webhook accordingly. But the question still remains - What is the exact format of reply from webhook that V2 can understand?

                                  – Sunil
                                  May 18 '18 at 6:45











                                • I would not suggest anything in V2 as I haven't moved to that yet. In V1 displaytext is one field could be needed.

                                  – Vinay P
                                  May 18 '18 at 6:58














                                0












                                0








                                0







                                Messages alone is not sufficient. Refer to Dialogflow V2 webhook fulfillment documentation for complete list of parameters expected and format of JSON.



                                Are you sure you are using V2 of the DialogFlow APIs?






                                share|improve this answer













                                Messages alone is not sufficient. Refer to Dialogflow V2 webhook fulfillment documentation for complete list of parameters expected and format of JSON.



                                Are you sure you are using V2 of the DialogFlow APIs?







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered May 17 '18 at 12:02









                                Vinay PVinay P

                                54513




                                54513













                                • Vinay P Thanks for responding. I am not using their SDK. I am receiving the POST request from Dialogflow in a flask app and parsing it. I am then sending a custom reply from flask app. I Used the link that you gave but still not working. Can you tell me how to use this - dialogflow.com/docs/reference/api-v2/rest/v2beta1/…

                                  – Sunil
                                  May 17 '18 at 12:50











                                • This another link says that all the values are optional.

                                  – Sunil
                                  May 17 '18 at 12:53













                                • @sunil I have done similar implementation using V1, it is not sufficient to send only the fields you have considered. And again the messages error would I guess appear only in V1, because V2 doesnt seem to have that field(I can be wrong with V2 as I havent worked on that). And I have not migrated to V2 as it is still not production ready.

                                  – Vinay P
                                  May 18 '18 at 5:24













                                • Thank you @Vinay for sticking with me. I changed the agent from V2 to V1 and I changed the reply from webhook accordingly. But the question still remains - What is the exact format of reply from webhook that V2 can understand?

                                  – Sunil
                                  May 18 '18 at 6:45











                                • I would not suggest anything in V2 as I haven't moved to that yet. In V1 displaytext is one field could be needed.

                                  – Vinay P
                                  May 18 '18 at 6:58



















                                • Vinay P Thanks for responding. I am not using their SDK. I am receiving the POST request from Dialogflow in a flask app and parsing it. I am then sending a custom reply from flask app. I Used the link that you gave but still not working. Can you tell me how to use this - dialogflow.com/docs/reference/api-v2/rest/v2beta1/…

                                  – Sunil
                                  May 17 '18 at 12:50











                                • This another link says that all the values are optional.

                                  – Sunil
                                  May 17 '18 at 12:53













                                • @sunil I have done similar implementation using V1, it is not sufficient to send only the fields you have considered. And again the messages error would I guess appear only in V1, because V2 doesnt seem to have that field(I can be wrong with V2 as I havent worked on that). And I have not migrated to V2 as it is still not production ready.

                                  – Vinay P
                                  May 18 '18 at 5:24













                                • Thank you @Vinay for sticking with me. I changed the agent from V2 to V1 and I changed the reply from webhook accordingly. But the question still remains - What is the exact format of reply from webhook that V2 can understand?

                                  – Sunil
                                  May 18 '18 at 6:45











                                • I would not suggest anything in V2 as I haven't moved to that yet. In V1 displaytext is one field could be needed.

                                  – Vinay P
                                  May 18 '18 at 6:58

















                                Vinay P Thanks for responding. I am not using their SDK. I am receiving the POST request from Dialogflow in a flask app and parsing it. I am then sending a custom reply from flask app. I Used the link that you gave but still not working. Can you tell me how to use this - dialogflow.com/docs/reference/api-v2/rest/v2beta1/…

                                – Sunil
                                May 17 '18 at 12:50





                                Vinay P Thanks for responding. I am not using their SDK. I am receiving the POST request from Dialogflow in a flask app and parsing it. I am then sending a custom reply from flask app. I Used the link that you gave but still not working. Can you tell me how to use this - dialogflow.com/docs/reference/api-v2/rest/v2beta1/…

                                – Sunil
                                May 17 '18 at 12:50













                                This another link says that all the values are optional.

                                – Sunil
                                May 17 '18 at 12:53







                                This another link says that all the values are optional.

                                – Sunil
                                May 17 '18 at 12:53















                                @sunil I have done similar implementation using V1, it is not sufficient to send only the fields you have considered. And again the messages error would I guess appear only in V1, because V2 doesnt seem to have that field(I can be wrong with V2 as I havent worked on that). And I have not migrated to V2 as it is still not production ready.

                                – Vinay P
                                May 18 '18 at 5:24







                                @sunil I have done similar implementation using V1, it is not sufficient to send only the fields you have considered. And again the messages error would I guess appear only in V1, because V2 doesnt seem to have that field(I can be wrong with V2 as I havent worked on that). And I have not migrated to V2 as it is still not production ready.

                                – Vinay P
                                May 18 '18 at 5:24















                                Thank you @Vinay for sticking with me. I changed the agent from V2 to V1 and I changed the reply from webhook accordingly. But the question still remains - What is the exact format of reply from webhook that V2 can understand?

                                – Sunil
                                May 18 '18 at 6:45





                                Thank you @Vinay for sticking with me. I changed the agent from V2 to V1 and I changed the reply from webhook accordingly. But the question still remains - What is the exact format of reply from webhook that V2 can understand?

                                – Sunil
                                May 18 '18 at 6:45













                                I would not suggest anything in V2 as I haven't moved to that yet. In V1 displaytext is one field could be needed.

                                – Vinay P
                                May 18 '18 at 6:58





                                I would not suggest anything in V2 as I haven't moved to that yet. In V1 displaytext is one field could be needed.

                                – Vinay P
                                May 18 '18 at 6:58











                                0














                                The field messageswas renamed/refactored to fulfillmentMessages - "can not find" means that it is not a property in the definition.
                                This is some comparable result accepted by v2:



                                {
                                "fulfillmentText": "response text",
                                "fulfillmentMessages": [{"simpleResponses": {"simpleResponses": [ {
                                "textToSpeech": "response text",
                                "displayText": "response text"
                                }]}}]
                                }





                                share|improve this answer




























                                  0














                                  The field messageswas renamed/refactored to fulfillmentMessages - "can not find" means that it is not a property in the definition.
                                  This is some comparable result accepted by v2:



                                  {
                                  "fulfillmentText": "response text",
                                  "fulfillmentMessages": [{"simpleResponses": {"simpleResponses": [ {
                                  "textToSpeech": "response text",
                                  "displayText": "response text"
                                  }]}}]
                                  }





                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    The field messageswas renamed/refactored to fulfillmentMessages - "can not find" means that it is not a property in the definition.
                                    This is some comparable result accepted by v2:



                                    {
                                    "fulfillmentText": "response text",
                                    "fulfillmentMessages": [{"simpleResponses": {"simpleResponses": [ {
                                    "textToSpeech": "response text",
                                    "displayText": "response text"
                                    }]}}]
                                    }





                                    share|improve this answer













                                    The field messageswas renamed/refactored to fulfillmentMessages - "can not find" means that it is not a property in the definition.
                                    This is some comparable result accepted by v2:



                                    {
                                    "fulfillmentText": "response text",
                                    "fulfillmentMessages": [{"simpleResponses": {"simpleResponses": [ {
                                    "textToSpeech": "response text",
                                    "displayText": "response text"
                                    }]}}]
                                    }






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Aug 2 '18 at 15:15









                                    Yahoo SeriousYahoo Serious

                                    2,25712226




                                    2,25712226






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50390670%2fwebhook-call-failed-error-failed-to-parse-webhook-json-response-cannot-find-f%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Contact image not getting when fetch all contact list from iPhone by CNContact

                                        count number of partitions of a set with n elements into k subsets

                                        A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks