Question

Line break doesn't work with webhook PUT

  • 19 July 2021
  • 1 reply
  • 270 views

Userlevel 1

Hey guys,

I have a trigger from the parser app. When the parsed email body contains line breaks, I can’t use that field in my JSON webhook as the app gives me the following error message: “The app returned "Server could not parse JSON".”

It works just fine if I use the standard action from Zendesk, but the custom call gives me the error. The problematic part of the code is the “body” tag, where the line breaks cause troubles. Any thoughts?

 

unflatten:	yes
method: PUT
headers:
Content-Type: application/json
auth: user|PW
data: {
"ticket": {
"status": "open",
"comment": {
"body": "This,
is where the line breaks appear.

Can anybody help?",
"author_id": "1900616036114"
}
}
}
url: https://domain.zendesk.com/api/v2/tickets/2081.json
pass_through: false

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +10

Hey @Johannes

We noticed that you also posted about this same issue in another thread. I’m going to close this thread but wanted to leave a link to the other thread for anyone else with the same question that wants to follow along: