Skip to main content

Hey guys,

I’m trying to post a comment from Zendesk as webhook, which generally works just fine. However, as soon as the message is written with line breaks the webhook field structure gets affected. This makes is impossible to access the fields in actions further down in the Zap.

Any ideas?

 

Webhook without the line break:

Outbound message

email_address: 4149523239385f6d6573736167696e675f3236363435393533332d3939363632303234352d39373333303737373434@test.com

message: Message without a line break

 

Webhook with line break:

Outbound message
b
{
"email_address": "4149523239385f6d6573736167696e675f3236363435393533332d3939363632303234352d39373333303737373434@test.com",
"message": "Hi Peter,
This is a message with a couple of line breaks
Best
Johannes"
}
]

 

This is the body I’m sending from Zendesk:

e
{
"email_address": "{{ticket.requester.email}}",
"message": "{{ticket.latest_public_comment}}"
}
]

 

@Johannes please post me an example here https://hooks.zapier.com/hooks/catch/4905176/b212ejl/


Hey @Wemakefuture,

just sent you two examples. One with and one without line breaks.

 

Thanks

Johannes


Thanks I saw the data, it is really nested and unstructured. I will try some. 


Python code: 

s = input_dataa'st']
import urllib.parse
d = urllib.parse.parse_qs(s.replace("%22%5D%0A%7D%0A%5D","").replace("%0A","").replace("%5B%222",""))

output = {'id': d}

From here try to remove everything before “message” with a text formater (I think its the most efficent way) 

The dict (json) is badly designed by zendesk via the query they send over.

Use the formater Text after the code: 


 

 

Now you could replace the l“

With more time one could maybe do it better with code - but as hotfix it should work.