Re: Special characters send by webhook

Daria_Kropyvian
Level 2

Special characters send by webhook

Hello,

I need your help please in my issue with a webhook.

To connecte our Marketo with CRM, we created a webhook with template in JSON which send all necessary information about lead from Marketo to CRM.

 

My problem is that we've created in Marketo a field "Message" where there is a texte about demand of a lead or our comments. Except that, we speak French and there are many different caracteres in this language. When we send information through webhook to CRM, in activity log of a lead the message is presented correctely but in our CRM tool we see strang signes on the place of é,à.... 

Team of developers of CRM  explaines me that the information they need to synchronize Marketo with CRM  is the encoding page. on standard , UTF8 is used. They usk me to provide the information about  which encoding page  Marketo use for this interface. I don't understand where to look for this information. My webhook's playload templete is in JSON.

 

Can you help me please ? 

DKR
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Special characters send by webhook

The default charset for JSON is already UTF-8 (this is in the JSON standard).

 

When a JSON client app like Marketo encounters non-Latin-1 characters, it may use their UTF-8 representations or use \uNNNN escapes. Both of these are 100% valid per the JSON standard, and any JSON server app must be able to interpret both variations.

 

However, Marketo can fail to set the HTTP Content-Type correctly (even though the payload conforms to JSON requirements). To make sure the right Content-Type is sent, set Webhooks Actions » Set Custom Header like so:

 

SanfordWhiteman_0-1635782578749.png

 

But you didn’t actually provide examples of the “string signs” so it’s difficult to know exactly where you’ve gone wrong.

Daria_Kropyvian
Level 2

Re: Special characters send by webhook

Thank you for your answer and tips.

 

The header of this webhook has this parameters : Content-Type - application/json.

Exemple : 

Exemple  of JSON sent by  webhook of Marketo :

{"data":{ "job":"leadcreation", "contact": { "id":"XXXXX", "email":XXXX, "firstname":"XXX", "lastname":"XXX", "co_jobtitle_standardized":"JTI0128", "co_department":"DEP0005", "co_country":"FRA", "co_phone_fixed":"", "co_phone_mobile":"" }, "crm_lead_title":"Lead provenant de Marketo", "crm_lead_sourcecampaign":"webinaires_decarbonation_Marketo", "crm_lead_origin":"mailing", "crm_lead_description":"Le contact a visionné le replay EcoCarbon" } } }.

 

But in CRM we found :

Daria_Kropyvian_0-1635843144427.png

 

Best regards,

DKR
SanfordWhiteman
Level 10 - Community Moderator

Re: Special characters send by webhook

Then the problem is on the other end. Marketo is sending the correct string encoding and the relevant Content-Type header.