I Raw response for the API Status code 400

Hie everyone. I am trying to initialize API for connection to create a chatbot but I keep getting an error message:
Raw response for the API
Status code 400…

This is the json code. What am I missing?

Probably messages should be an array of objects instead of an array with a single string.
You should double check the documentation of the API.

1 Like

Thank you for your response. Can you please explain what you mean by that?

  1. this is an array of objects: [{"id": "hello"}, {"id": "world"}]
  2. this is an array with just a single string ["hello world"]

What you are doing with your setup is the second thing at best or creating an invalid json at worst (if your dynamic data is {"key": "value"} and you put it inside quotes you get "{"key": "value"}" which is not a valid json)

You should start with removing those extra quotes. Then check that whatever you put inside that array is valid json and follows the specifications of the API you are using.
It’s all written in the documentation.

1 Like