Title: tecumseh's Replies | WordPress.org

---

# tecumseh

  [  ](https://wordpress.org/support/users/tecumseh/)

 *   [Profile](https://wordpress.org/support/users/tecumseh/)
 *   [Topics Started](https://wordpress.org/support/users/tecumseh/topics/)
 *   [Replies Created](https://wordpress.org/support/users/tecumseh/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/tecumseh/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/tecumseh/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/tecumseh/engagements/)
 *   [Favorites](https://wordpress.org/support/users/tecumseh/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact form 7 TO API] JSON Not escaped](https://wordpress.org/support/topic/json-not-escaped/)
 *  [tecumseh](https://wordpress.org/support/users/tecumseh/)
 * (@tecumseh)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/json-not-escaped/#post-10081762)
 * Thank god I thought I was going mad [Here’s my topic](https://wordpress.org/support/topic/line-breaks-break-api/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact form 7 TO API] Line breaks break API](https://wordpress.org/support/topic/line-breaks-break-api/)
 *  Thread Starter [tecumseh](https://wordpress.org/support/users/tecumseh/)
 * (@tecumseh)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/line-breaks-break-api/#post-10065754)
 * So I reinstalled everything to get rid of my changes and switched to using a 
   more normal template.
 * I can confirm that multiple line breaks in the message means the message **do**
   not get sent by the API.
 * Also,
 * A message containing this: “” Did I just break you? “”
 * would lead the API to send: “message”: “\”\” Did I just break you? \”\” ”
 * CF7 does clean up the message before emailing it, is it not possible to retrieve
   the submission after it’s been formatted?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact form 7 TO API] Line breaks break API](https://wordpress.org/support/topic/line-breaks-break-api/)
 *  Thread Starter [tecumseh](https://wordpress.org/support/users/tecumseh/)
 * (@tecumseh)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/line-breaks-break-api/#post-10053344)
 * Sorry about the delay, I’ve been ill for a while.
 * As you can imagine I’d like to avoid handing out access to my server unless absolutely
   necessary, sorry.
 * Can you confirm that the following use cases work in your own environment?
 * 1 – Adding new lines to your message in the form, does the API sanitize these?
   
   2 – Single quotes/double quotation marks – a combination of these tends to cause
   issues if within the message body.
 * (I just want to know if it’s my slightly weird JSON template causing issues :/)
 * I added something like this to the string in the parse_json function to fix line
   breaks
 *     ```
       trim( preg_replace( '/(\r\n)|\n|\r/', '\\n', $string))
       ```
   
 * Which worked and allowed large datasets to be sent & fixed line breaks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact form 7 TO API] Line breaks break API](https://wordpress.org/support/topic/line-breaks-break-api/)
 *  Thread Starter [tecumseh](https://wordpress.org/support/users/tecumseh/)
 * (@tecumseh)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/line-breaks-break-api/#post-9888535)
 * `{"body": {"name":"[your-name]", "email":"[your-email]", "subject":"[your-subject]","
   your-message":"[your-message]"}}`
 * I know the fields are already contained within the body, but my api expects.
 *     ```
        },
           "body": {
               "body": {
       ```
   
 * Removing the additional “body” from the JSON template I am using also causes 
   the issue to persist.
 * In my attempts to fix it, I did attempt using nl2br, that allowed the POST to
   be sent to my api but was invalid JSON.

Viewing 4 replies - 1 through 4 (of 4 total)