Response Returns as Bad Request
If you receive HTML as a response of “Bad Request” instead of JSON, it is possible the POST body parameter is not valid JSON.
For example, if you send this invalid JSON:
A response of “Bad Request” will be returned. The code above has three issues: a missing comma on post
, the post text has a double set of ” quotes without escaping, and a missing end quote on platform
. The valid JSON should be:
You can test your JSON by POSTing to the following URL to validate your JSON. Be sure to set the Content-Type to text/plain
.
We recommend trying the call in Postman, which can help correct JSON formatting. Please see the next section for more information.
Validate JSON
You can validate your JSON by using either an online linter, such as https://jsonlint.com/ or using Postman.
You may also use our /validate/json
endpoint: