articulate: Webhook not working for body type json

  • Did you download a release or pull from Master? Which release? – Working form release - v0.11.2
  • What operating system are you running? – Ubuntu 16.04
  • Are you running locally or in the cloud? – Running locally
  • Which browser are you using? – Chrome : Version 69

Setup the articulate in local successfully. So when i try to enable a webhook definition in an intent it not working and returning “internal server error”.

SyntaxError: Uncaught error: Unexpected token b in JSON at position 16 api_1 | at JSON.parse (<anonymous>) api_1 | at module.exports (/usr/src/app/modules/agent/tools/callWebhook.agent.tool.js:23:195) api_1 | at module.exports (/usr/src/app/modules/agent/tools/respondFulfilledIntent.agent.tool.js:28:9) api_1 | at module.exports (/usr/src/app/modules/agent/tools/respondIntent.agent.tool.js:137:9) api_1 | at Object.module.exports [as respond] (/usr/src/app/modules/agent/tools/respond.agent.tool.js:219:17) api_1 | at Async.waterfall (/usr/src/app/modules/agent/controllers/converse.agent.controller.js:101:24) api_1 | at nextTask (/usr/src/app/node_modules/async/dist/async.js:5274:14) api_1 | at next (/usr/src/app/node_modules/async/dist/async.js:5281:9) api_1 | at /usr/src/app/node_modules/async/dist/async.js:906:16 api_1 | at Async.parallel (/usr/src/app/modules/agent/controllers/converse.agent.controller.js:78:24)

agent_webhook_error

The error telling that it not a proper json.


In webhook definition my request body json looks like this:

{
	"text": "{{text}}",
	"intent": "{{JSONstringify intent}}",
	"slots": "{{JSONstringify slots}}"
}

Request Body Type: JSON

it does’nt trigger the error when Body Type set to None. Our Back end is python. But When using None as body type webhook triggered the POST http request but the request body is empty. I did’t get any values in request body. What was the issue? is it with the above json?.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

We’ll likely the no slots is the problem given that you are trying to include them in your payload. Can you try removing them?