Question

Zap from Salesforce to Confluence failing because of special characters

  • 28 July 2023
  • 1 reply
  • 101 views

I am taking text from a Salesforce Task and sending it to Confluence as a new page. Working like a charm. However, in one of our notes, there is an "&" and it is causing this error.

com.atlassian.confluence.api.service.exceptions.BadRequestException: Error parsing xhtml: Unexpected character ' ' (code 32) (missing name?)

Yet I can take the same text and paste it directly into a confluence page without issue.  I am sure special characters are going to occur occasionally in our teams Salesforce notes.

Suggestions?


1 reply

Userlevel 7
Badge +12

Hey @MMonteyne

I actually ran into a similar issue recently where the “&” was causing some issues. 

For me, the fields with & were being used as query parameters in the API call.  Since & is a special character that separates query variables, I was getting a similar error.

I was able to fix it by changing the “&” characters into “%26” in the code.

 

For you, I would add a step where you would replace all instances of & with “%26” or just “and” to potentially fix this.

 

Hope this helps!

Reply