Bad Request 400
# support
t
Hey peeps, in json editor and postman the body is returning a “expected ‘,’ or ‘] after array element error on both platforms. I added ‘,’ after closing with } but the error still shows Please advise
v
Hi @Tarek Maximus, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Server Events]() * [Create Assistant]() * [Create Phone Call]() * [Buy Phone Number]() -----------------------------
### Answer It sounds like you're encountering a syntax error in your JSON payload. This is a common issue when the JSON structure is not formatted correctly. Here are a few things to check: 1. Ensure that all objects
{}
and arrays
[]
are properly closed. 2. After each key-value pair in an object (except the last one), there should be a comma
,
. 3. In arrays, ensure there's a comma
,
between elements (except after the last element). Here’s a basic structure for reference:
Copy code
json
{
  "key1": "value1",
  "key2": "value2",
  "arrayKey": [
    "arrayValue1",
    "arrayValue2"
  ]
}
Make sure your JSON matches the correct structure and all necessary commas are in place. If the issue persists, the problem might be more specific to the payload you're trying to send or a particular requirement of the API you're interacting with. Without visibility into the exact JSON and API endpoint, it's challenging to provide a more targeted solution.
Got it. Tagging @User for additional help.
s
Read the error man. Your JSON data is incorrect. Use chatgpt to fix it
t
Thank you Sahil, Vapi AI and GPT has been what got me this far. Got locked out for “unusual activity” after using heavily.
s
Use gemini 1.5 pro then 😅