dialogflow / fulfillment-webhook-json

Dialogflow's Fulfillment: Webhook JSON (Requests & Responses)
Apache License 2.0
191 stars 70 forks source link

Ask for sign in Dialogflow API V2 doesn't work #10

Open Anas-siddiqui opened 6 years ago

Anas-siddiqui commented 6 years ago

My dialogflow agent is connected to a webhook for fulfillment using API v2, when I try to response back with ask for sign in response it doesn't perform the appropriate function and instead outputs the response from Fallback intent. Asking for permissions however work but asking for sign in never works, following is the body which I am outputting.

{ "payload": { "google": { "expectUserResponse": true, "systemIntent": { "intent": "actions.intent.SIGN_IN", "data": {} } } } }

jaypatel-searce commented 6 years ago

I'm having the same issue, Did you solved it??

Anas-siddiqui commented 6 years ago

I'm having the same issue, Did you solved it??

Nope, still waiting for someone from Dialogflow to help.

zonder129 commented 6 years ago

Maybe you forgot to enable webhook?

Anas-siddiqui commented 6 years ago

Maybe you forgot to enable webhook?

No ,its not a problem with webhook because if my webhook was disabled then the request would have never reached my webhook to expect a response. In this case the webhook is responding back with the above JSON body to prompt the user for SIGN IN card but it doesn't work.

zonder129 commented 6 years ago

I see. My result is the same, but I guess this is exactly what is expected. As I understand, you need to create special event inside Dialogflow to catch response from Actions on Google to your sign in request. It doesn't comes back by default into the same intent it was called from. You can look inside your History in dialogflow and you will find out unhandled event that comes back to you from AoG. You can read how to properly create helper requests here: https://developers.google.com/actions/assistant/helpers

Anas-siddiqui commented 6 years ago

I see. My result is the same, but I guess this is exactly what is expected. As I understand, you need to create special event inside Dialogflow to catch response from Actions on Google to your sign in request. It doesn't comes back by default into the same intent it was called from. You can look inside your History in dialogflow and you will find out unhandled event that comes back to you from AoG. You can read how to properly create helper requests here: https://developers.google.com/actions/assistant/helpers

Even if I use the below JSON body which I got from the Helpers page, it also gives the same result and no request comes back to the webhook for sign in or anything.

{ "payload": { "google": { "conversationToken": "{\"state\":null,\"data\":{}}", "expectUserResponse": true, "expectedInputs": [ { "inputPrompt": { "initialPrompts": [ { "textToSpeech": "PLACEHOLDER_FOR_SIGN_IN" } ], "noInputPrompts": [] }, "possibleIntents": [ { "intent": "actions.intent.SIGN_IN", "inputValueData": {} } ] } ] } } }

zonder129 commented 6 years ago

Hi again, sorry for such a long time to respond. Use the same message as in your first message. Beside that, you will also need to enable sign in action on dialogflow web site in your intent that you expecting that message to come back. Action name is the same as the name of intent you sent to AoG (actions.intent.SIGN_IN), if I'm not mistaking. Look in your history, and I am shoore that you will have unhadled event, for me that was the key to solve this problem. At least, after you send back this request to sign in from fullfilment, account linking that you setted up before, must run.

daiangan commented 3 years ago

In Dialogflow, use the payload like this:

{
  "google": {
    "systemIntent": {
      "intent": "actions.intent.SIGN_IN",
      "data": {
        "@type": "type.googleapis.com/google.actions.v2.SignInValueSpec"
      }
    },
    "expectUserResponse": true
  }
}