FlowXO and Dialgoflow V2 API

(Mike Kwok) #1

Hi All,

Could you please advice how to integrate Flow XO with google dialogflow?
WHat needs to be fill in for below

  1. Request URL
  2. Method
  3. Content Type
  4. Body
  5. Headers
  6. Basic Authentication

Cheers, Mike

(Daniel Beckett) #2

Hi @Mike_Kwok

There’s a tutorial for Using Flow XO with Dialogflow but it is admittedly a bit out of date and doesn’t use v2 of the API. The steps should still work with the exception of the URL. The actual URL you want to send the request to is https://api.dialogflow.com/v1/query?v=20171210

If you take a look over that it should hopefully give you a good idea of where to start.

In regards to using V2 of the API I can’t say for certain if it’s possible to use with Flow XO. It may be possible using the Webhooks & HTTP service by setting up a custom API request. This would require that you reference their docs to setup the API request in your flow. I believe that the setup would be similar to what’s used in the tutorial I shared but with some changes to fields and endpoints.

The following page from Dialogflow’s docs may be able to help clarify:
https://dialogflow.com/docs/reference/v1-v2-migration-guide

Thanks,
Dan

(Louis Delav) #3

Hello Daniel,

Thanks you very much for the details.

I have some troubles with Dialogflow for the past 3 days.
I was using since many time your tutorial on medium to connect. But it no longer works.
I just tried it with the new link you’re using, it doesn’t work :frowning:

{
  "status": {
    "code": 401,
    "errorType": "unauthorized",
    "errorDetails": "Missing AccessToken Code: 401"
  }
}

While my header aren’t empty

Authorization: BEARER $$$$$$$$$$$$$$$$$$$$$ 
Content-Type: application/json; charset=utf-8

I think some modifications will happen with the V2 of the Dialogflow. Can you help me to reconnect the service?

(Daniel Beckett) #4

I’m sorry but at the moment we don’t have any guides to share for connecting to V2 of the Dialogflow API.

(Philip Mccarthy) #5

Hi Daniel

I read Louis’s last post with interest.

I’d been using dialogflow in conjunction with FlowXO successfully for many months.

And in recent weeks I discovered that my HTTP post step calling dialogflow was returning the following:

Status Code
401
Body
{
“status”: {
“code”: 401,
“errorType”: “unauthorized”,
“errorDetails”: “Missing AccessToken Code: 401”
}
}

I had not changed any aspect of this step, and had not converted my dialogflow agent from V1 to V2. It was built in V2.

Something has gone wrong. I tried your url of https://api.dialogflow.com/v1/query?v=20171210 which was different to that which I had from the tutorial, but it did not work either.

It seems to me that FlowXO is now unable to connect to a V1 dialogflow agent, and as the steps for connecting to a V2 agent using the new authentication requirements do not exist, we seem to be at a standstill.

Are you able to provide a way forwards?

Thanks, Phil.

(Daniel Beckett) #6

Hi @Philip_Mccarthy

As far as I’m aware V1 of Dialogflow’s API will be deprecated on October 23, 2019 so your webhooks should still be working. Nothing has been changed on the Flow XO side which should affect it.

You may want to double check your access token is still valid in the webhook. Perhaps the token was invalidated in your Dialogflow account?

Thanks,
Dan

(Louis Delav) #7

Hello Philip

I solve the problem ! Sorry I didn’t see your answer before.
Your query link is good, but in the Header
put Bearer instead of BEARER

For me it’s work. But it’s possible the link doesn’t work in September
We will have to plan a new way to call DialogFlow

(Philip Mccarthy) #8

Dear Louis

Thanks so much for following up on this, solved the issue. Who would have thought changing BEARER to Bearer would be the fix. I had to also make some changes in parsing the JSON returned because the structure of that had changed to.

Daniel Beckett: please note. The tutorial at https://medium.com/flowxo/using-flow-xo-with-api-ai-86f59e24cda6 uses BEARER instead of Bearer so anyone following that probably won’t get it to work.

And yes when Google change their authentication again later this year, it will mess things up again. I can successfully navigate myself through google authentication with scopes in .NET to upload files to google drive, write to google sheets etc. But have no idea how to do the same with FlowXO right now since the same programmatic tools don’t seem to exist in it.

Thanks, Phil

1 Like