Dialogflow fulfillment using HTTP responses





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have an azure function that gets json and returns json.
I want that upon intent being invoked on dialogflow, the function will be called and the response will be shown to the user. Because I'm using multiple intents, I can't put it simply in the webhook because I don't want the same logic for every intent.
I've tried to use the Inline editor and upon intent to make an HTTP request to my Azure function. However, whenever I tried using JavaScript library for HTTP ( Ajax
etc.. ) the Inline editor didn't recognize the library
If anyoune has an example of how to make HTTP Post Request with json parameters this would be a great help !










share|improve this question























  • Can you update your question to include your code, the package.json, and any errors that you may be encountering? medium.com/google-developer-experts/…

    – Prisoner
    Nov 26 '18 at 15:29


















0















I have an azure function that gets json and returns json.
I want that upon intent being invoked on dialogflow, the function will be called and the response will be shown to the user. Because I'm using multiple intents, I can't put it simply in the webhook because I don't want the same logic for every intent.
I've tried to use the Inline editor and upon intent to make an HTTP request to my Azure function. However, whenever I tried using JavaScript library for HTTP ( Ajax
etc.. ) the Inline editor didn't recognize the library
If anyoune has an example of how to make HTTP Post Request with json parameters this would be a great help !










share|improve this question























  • Can you update your question to include your code, the package.json, and any errors that you may be encountering? medium.com/google-developer-experts/…

    – Prisoner
    Nov 26 '18 at 15:29














0












0








0








I have an azure function that gets json and returns json.
I want that upon intent being invoked on dialogflow, the function will be called and the response will be shown to the user. Because I'm using multiple intents, I can't put it simply in the webhook because I don't want the same logic for every intent.
I've tried to use the Inline editor and upon intent to make an HTTP request to my Azure function. However, whenever I tried using JavaScript library for HTTP ( Ajax
etc.. ) the Inline editor didn't recognize the library
If anyoune has an example of how to make HTTP Post Request with json parameters this would be a great help !










share|improve this question














I have an azure function that gets json and returns json.
I want that upon intent being invoked on dialogflow, the function will be called and the response will be shown to the user. Because I'm using multiple intents, I can't put it simply in the webhook because I don't want the same logic for every intent.
I've tried to use the Inline editor and upon intent to make an HTTP request to my Azure function. However, whenever I tried using JavaScript library for HTTP ( Ajax
etc.. ) the Inline editor didn't recognize the library
If anyoune has an example of how to make HTTP Post Request with json parameters this would be a great help !







database azure actions-on-google dialogflow






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 26 '18 at 13:32









CmpScience LearnerCmpScience Learner

397




397













  • Can you update your question to include your code, the package.json, and any errors that you may be encountering? medium.com/google-developer-experts/…

    – Prisoner
    Nov 26 '18 at 15:29



















  • Can you update your question to include your code, the package.json, and any errors that you may be encountering? medium.com/google-developer-experts/…

    – Prisoner
    Nov 26 '18 at 15:29

















Can you update your question to include your code, the package.json, and any errors that you may be encountering? medium.com/google-developer-experts/…

– Prisoner
Nov 26 '18 at 15:29





Can you update your question to include your code, the package.json, and any errors that you may be encountering? medium.com/google-developer-experts/…

– Prisoner
Nov 26 '18 at 15:29












2 Answers
2






active

oldest

votes


















0














If you need to add a library to the Dialogflow Inline Editor, you can click on the "package.json" tab and edit it to include the npm specification for the package you wish to include.



enter image description here






share|improve this answer
























  • Well that's what I tried. However, using the library in the index.js using require emit an error that the package doesn't exist

    – CmpScience Learner
    Nov 26 '18 at 14:50



















0














SOLVED - if anyone else comes across this problem, make sure your Azure function returns Google.Cloud.Dialogflow.V2 . This way it matches the DialogFlow and he can understand your response easily :)






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%2f53482249%2fdialogflow-fulfillment-using-http-responses%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If you need to add a library to the Dialogflow Inline Editor, you can click on the "package.json" tab and edit it to include the npm specification for the package you wish to include.



    enter image description here






    share|improve this answer
























    • Well that's what I tried. However, using the library in the index.js using require emit an error that the package doesn't exist

      – CmpScience Learner
      Nov 26 '18 at 14:50
















    0














    If you need to add a library to the Dialogflow Inline Editor, you can click on the "package.json" tab and edit it to include the npm specification for the package you wish to include.



    enter image description here






    share|improve this answer
























    • Well that's what I tried. However, using the library in the index.js using require emit an error that the package doesn't exist

      – CmpScience Learner
      Nov 26 '18 at 14:50














    0












    0








    0







    If you need to add a library to the Dialogflow Inline Editor, you can click on the "package.json" tab and edit it to include the npm specification for the package you wish to include.



    enter image description here






    share|improve this answer













    If you need to add a library to the Dialogflow Inline Editor, you can click on the "package.json" tab and edit it to include the npm specification for the package you wish to include.



    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 26 '18 at 14:04









    PrisonerPrisoner

    36k33562




    36k33562













    • Well that's what I tried. However, using the library in the index.js using require emit an error that the package doesn't exist

      – CmpScience Learner
      Nov 26 '18 at 14:50



















    • Well that's what I tried. However, using the library in the index.js using require emit an error that the package doesn't exist

      – CmpScience Learner
      Nov 26 '18 at 14:50

















    Well that's what I tried. However, using the library in the index.js using require emit an error that the package doesn't exist

    – CmpScience Learner
    Nov 26 '18 at 14:50





    Well that's what I tried. However, using the library in the index.js using require emit an error that the package doesn't exist

    – CmpScience Learner
    Nov 26 '18 at 14:50













    0














    SOLVED - if anyone else comes across this problem, make sure your Azure function returns Google.Cloud.Dialogflow.V2 . This way it matches the DialogFlow and he can understand your response easily :)






    share|improve this answer




























      0














      SOLVED - if anyone else comes across this problem, make sure your Azure function returns Google.Cloud.Dialogflow.V2 . This way it matches the DialogFlow and he can understand your response easily :)






      share|improve this answer


























        0












        0








        0







        SOLVED - if anyone else comes across this problem, make sure your Azure function returns Google.Cloud.Dialogflow.V2 . This way it matches the DialogFlow and he can understand your response easily :)






        share|improve this answer













        SOLVED - if anyone else comes across this problem, make sure your Azure function returns Google.Cloud.Dialogflow.V2 . This way it matches the DialogFlow and he can understand your response easily :)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 27 '18 at 14:52









        CmpScience LearnerCmpScience Learner

        397




        397






























            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%2f53482249%2fdialogflow-fulfillment-using-http-responses%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

            Wiesbaden

            Marschland

            Dieringhausen