Title: Response Code: 400
Last modified: January 27, 2026

---

# Response Code: 400

 *  [poklos](https://wordpress.org/support/users/poklos/)
 * (@poklos)
 * [4 months ago](https://wordpress.org/support/topic/response-code-400-2/)
 * Hello!
 * I’m trying to integrate **Contact Form 7 → Webhook** with an external REST API(
   RO App).
 * The API **requires a raw JSON object** in the request body (Content-Type: application/
   json).
 * However, your plugin seems to always send the body as a **stringified JSON**,
   not as a real JSON object.
 * This is clearly visible in the debug email/logs:
 *     ```wp-block-code
       Request Body:"{   \"lead_type_id\": 318825,  \"contact_name\": \"John Doe\",  \"contact_phone\": \"123456789\",  \"description\": \"test\"}"
       ```
   
 * Because the body is wrapped in quotes, the receiving API treats it as a **string**,
   fails to parse JSON, and returns validation errors (required fields reported 
   as empty).
 * Expected request body (raw JSON object, without quotes):
 *     ```wp-block-code
       {  "lead_type_id": 318825,  "contact_name": "John Doe",  "contact_phone": "123456789",  "description": "test"}
       ```
   
 *     ```wp-block-code
       "CF7 to Webhook" has a built-in feature that detects when a webhook fails and notifies you with this automated email.- Form: #892 - Contact form 2- Webhook: https://api.roapp.io/lead/- Error: "Webhook returned a error code."Request Method:POSTRequest Headers:{"Content-Type":"application\/json","Authorization":"Bearer MY API","Accept":"application\/json"}Request Body:"{\n  \"_notify_leadtype_id\": 318825,\n  \"contact_name\": \"Filip Pok\\u0142osiewicz\",\n  \"contact_phone\": \"509465301\",\n  \"contact_email\": \"filip.poklosiewicz@gmail.com\",\n  \"description\": \"terst\"\n}"Response Code:400Response Message:"Bad Request"Response Headers:{}Response Body:"{\"code\": 400, \"success\": false, \"message\": {\"validation\": {\"_notify_leadtype_id\": [\"Field cannot be empty\"]}}}"Im getting those errors. Can you help me with it?
       ```
   
 * **My questions:**
    1. Is there a way in your plugin to send the request body as a **raw JSON object**,
       not a string?
    2. Is there a setting to disable JSON stringification / escaping?
    3. If not, is this a known limitation of the plugin?
 * At the moment, this behavior makes it impossible to integrate with APIs that 
   strictly validate JSON bodies.
 * Thank you in advance for clarification.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fresponse-code-400-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mário Valney](https://wordpress.org/support/users/mariovalney/)
 * (@mariovalney)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/response-code-400-2/#post-18812657)
 * Hi! Sorry for taking some time to get back to you.
 * Thanks for the detailed report and examples.
 * A quick clarification first: HTTP requests never send a “JSON object” as a native
   data type. They always send text (bytes). When using `Content-Type: application/
   json`, the expected payload is a JSON-formatted string, for example:
 *     ```wp-block-code
       { "field": "value" }
       ```
   
 * This is exactly what the plugin sends.
 * The body you see in the debug email: `"{ \"field\": \"value\" }"` is a string
   _representation of the payload used for logging purposes_, not the actual payload
   being transmitted over the network.
 * In the request itself, the plugin sends a regular JSON.
 * There is no additional JSON stringification happening at the request layer in
   the plugin.
 * 
   **About your error**
 * From the response you shared, it looks like the request is reaching the RO App
   endpoint and being processed, but the API is rejecting it due to **validation**(
   missing/empty required fields).
 * According to RO App’s “Create Inquiry” endpoint documentation:
    - **client_id **OR “**contact_phone + contact_name**” are required.
    - **leadtype_id **(not **_notify_leadtype_id**) is required.
 * That said, the PHP example in their documentation also uses **json_encode**:
 * ![](https://i0.wp.com/i.imgur.com/vVg7D9t.png?ssl=1)
 * Are you using that endpoint? [https://roapp.readme.io/reference/create-lead](https://roapp.readme.io/reference/create-lead)
 * Please let me know if you still need help.

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fresponse-code-400-2%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/cf7-to-zapier/assets/icon-256x256.jpg?rev=3214555)
 * [CF7 to Webhook](https://wordpress.org/plugins/cf7-to-zapier/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-to-zapier/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-to-zapier/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-to-zapier/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-to-zapier/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-to-zapier/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mário Valney](https://wordpress.org/support/users/mariovalney/)
 * Last activity: [3 months, 3 weeks ago](https://wordpress.org/support/topic/response-code-400-2/#post-18812657)
 * Status: not resolved