Answered

How to add formatting to Conversation notes via API

  • 8 January 2024
  • 5 replies
  • 92 views

I’m writing a helper app that adds notes to conversations and would like to be able to format the contents.

Basis HTML seems to work OK but I’d like to add a code block and a table and neither are well supported. 

Can anyone point me at the correct documentation or provide other guidance?

icon

Best answer by Ebenezer.Laleye 17 January 2024, 17:01

View original

5 replies

Userlevel 2
Badge +4

Hello Tom,

You can find the answer in our REST API reference documentation.

For Example:
Body of the note, like the one below:
 


Will be saved as follows in our database:

"body": "<p class=\"no-margin\"><code>ddddddddd</code></p>\n<p class=\"no-margin\"></p>\n<pre><code>dddddsssssaaaa<br>ddddsssaaaa</code></pre>",

If you ever get stuck, you can always reverse engineer the requests by using the Retrieve a Conversation endpoint.
Simply create a desired note in the GUI and try to get it via API to see how it is formatted.

I hope it will help you resolve your issue.
 

Thanks for the help. I can’t say that I find anything on the linked page that defines the limitations of the HTML that can be used in a note.

Your example did help a lot. However, the <pre> tag does not seem to work effectively for me as I’m getting spaces and other characters stripped out.

Also, having odd issues where formatting (bold, italic, headings) don’t end when the tag is closed.

 

Userlevel 2
Badge +4

Can you share your specific request here, please so I can help you fix it? 

Here is the body that is sent”

<pre><code>| Date       | Reason          | Subreason            |<br>
|------------|-----------------|----------------------|<br>
| 2023-12-13 | SumRejFin | BADPROOFOFADDRESS |<br>
| 2023-12-13 | MultAcc | |<br>
| 2023-12-13 | BreOfTCS | |</code></pre>

Here is the result in the UI

notice that the spaces are suppressed

Userlevel 2
Badge +3

Hi Tom! Ebenezer here from Engineering Support👋.

I see you were speaking with my colleague Stacy via email and you were able to find another approach that works for you!

That's great, let me know if you have anymore questions on this!

Reply