DailogFlow API fulfillment to public endpoint gives Unauthorized 401

772 views Asked by At

I am new to this Dialog flow which I am using to try to connect my Google assistant with Salesforce based system.

Now, I have a public facing GET end point which I want to call from DialogAPI fulfillment

enter image description here

But it always fails with

"webhookStatus": { "code": 16, "message": "Webhook call failed. Error: UNAUTHENTICATED, State: URL_ERROR, Reason: ERROR_AUTHENTICATION, HTTP status code: 401." }

I cannot access the endpoint GET URL without any issues. For reference, this is the endpoint - https://assistant-check-developer-edition.eu44.force.com/assistant/services/apexrest/Dialogflow

which just returns a string.

Can someone please help me what I am missing here?

Thank you

1

There are 1 answers

0
Eduardo Ortiz On

From Google’s documentation:

“If you plan to use the Dialog Flow API, you need to set up authentication. Any client application that uses the API must be authenticated and granted access to the requested resources.”

From the image you are sharing, you are missing an authorization method when you are trying to make the GET call. In this link, you can read how to achieve a proper authorization method in your API.