1

My Dialogflow project is not making proper webhook calls. I ran the curl command, given to you while testing, in command prompt.

curl -H "Content-Type: application/json; charset=utf-8"  -H "Authorization: Bearer ya29.c.Ko8BvQcQFJJgEzKprtZn9kWStTWE5trMyYN8_oilT_4LInyASeCGiBcrrSepTvrjomVCZKSaFF_RaCYoC_yBU0LWM8ODzRlliAHQv1C97veQuxNjq_aeWLEN361drz6Rk_WEn7hl52DRN32ee4xmV97rW8nqBVFsbPykXdkjj83iKWjwKv9FKVhNJNOfMaejMH4"  -d "{\"queryInput\":{\"text\":{\"text\":\"run\",\"languageCode\":\"en\"}},\"queryParams\":{\"timeZone\":\"America/New_York\"}}" "https://dialogflow.googleapis.com/v2/projects/weathersample-ifjqjr/agent/sessions/ed2ec645-d8da-55b7-f71e-d0ee8d7ff2bb:detectIntent"

The response I got back was:

    {
  "responseId": "5eea8256-8771-4db1-8b51-2c82e31c7bf4-2e39b744",
  "queryResult": {
    "queryText": "run",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentText": "Error: Speed test has not been called properly",
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            "Error: Speed test has not been called properly"
          ]
        }
      }
    ],
    "outputContexts": [
      {
        "name": "projects/weathersample-ifjqjr/agent/sessions/ed2ec645-d8da-55b7-f71e-d0ee8d7ff2bb/contexts/location",
        "lifespanCount": 5
      },
      {
        "name": "projects/weathersample-ifjqjr/agent/sessions/ed2ec645-d8da-55b7-f71e-d0ee8d7ff2bb/contexts/weathercontext-followup",
        "lifespanCount": 2
      }
    ],
    "intent": {
      "name": "projects/weathersample-ifjqjr/agent/intents/98199125-8fc6-466f-98b6-7648e14b06e7",
      "displayName": "runSpeedTest"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 2439
    },
    "languageCode": "en"
  },
  "webhookStatus": {
    "code": 14,
    "message": "Webhook call failed. Error: UNAVAILABLE."
  }

At the bottom of this response there is a "webhookStatus" object with an unavailable error and code of 14. Does anyone know what that code means?

Tony Moon
  • 15
  • 1
  • 4
  • The question is possible duplicate to https://stackoverflow.com/questions/59582045/dialogflow-fulfilment-webhook-call-failed Are you trying to write web hook in the inline editor, or you have your own service running somewhere? If inline, you should be able to find some more details in History tab. – Roman Feb 18 '20 at 17:22

1 Answers1

0

Webhook is basically HTTP callback which will be triggered when the web-hook enabled intents are matched. Code:14 UNAVAILABLE means that it is looking for a handling function mapped to "runSpeedTest" intent which is not present in the web-hook provided. You can test it in Fulfilment->Inline Editor before deploying it externally.

riddhi
  • 146
  • 5
  • Thanks, it's not so much that runSpeedTest was not present, but rather it was blocked. I neglected to enable billing on my account, thus had no access to webhooks. – Tony Moon Feb 21 '20 at 19:40