Chat21 Error 400 Unauthorized -> tiledesk request

Hello,

I installed via docker compose tiledesk server, I configured the Chat21 function.
But, when I write in widget chat/simulator, the accound is automatically logout and in ngrok I received Unauthorized and also in firebase functions log the same error.

webhook-onMessage
StatusCodeError: 401 - “Unauthorized”
at new StatusCodeError (/workspace/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/workspace/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/workspace/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/workspace/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:466:23)
at Request. (/workspace/node_modules/request/request.js:1161:10)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:466:23)
at IncomingMessage. (/workspace/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:286:20)
at IncomingMessage.emit (events.js:203:15)
at IncomingMessage.EventEmitter.emit (domain.js:466:23)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

I missing something?

Hi,
Have you configured the Chat21 webhook as described here: https://developer.tiledesk.com/installation/chat21-installation/chat21-firebase-installation#2-2-2-setting-up-the-webhook-endpoint ?

The webhook endpoint must be: firebase functions:config:set webhook.url=<PUBLIC_TILEDESK_SERVER_URL>/chat21/requests

Can you show me your chat21 webhook.url config parameter running: firebase functions:config:get ?

Hi,

Yes, but like this <PUBLIC_TILEDESK_SERVER_URL>/TILEDESK_PROJECT_ID/requests
(now, try with JWS token, but for the moment is the same)

firebase functions:config:get
{
“webhook”: {
“enabled”: “true”,
“url”: “https://b7d3ede8bee0.ngrok.io/5fdb77a2f189520019b78c64/requests
},
“secret”: {
“token”: “******************************************************…”
}

Hi
your Chat21 Webhook url is wrong.

It must be https://b7d3ede8bee0.ngrok.io/chat21/requests and not https://b7d3ede8bee0.ngrok.io/5fdb77a2f189520019b78c64/requests

because your Tiledesk base url is https://b7d3ede8bee0.ngrok.io and the endpoint is /chat21/requests