Newline on NOTE in Engagement API

Eddie_Z
Member

I am trying to create NOTE engagement on a contact, my goal is to create something like this:
Topic:
line1
line2
line3

And I am passing a string like this:
“Topic:\nline1\nline2\nline3”

But when it shows on the Hubspot it becomes:
“Topic:line1lin2line3”

I am using this API: http://developers.hubspot.com/docs/methods/engagements/create_engagement

0 Upvotes
11 Replies 11
seb_fairchild
Member

@Eddie_Z

You can use </br> for line breaks.

Sebastian

0 Upvotes
Eddie_Z
Member

Thank you! it worked.

Gaston_Krasny
Member

Is this still working? It dos not worl for me

0 Upvotes
Derek_Gervais
HubSpot Employee

Hi @Gaston_Krasny,

I did some testing and using </br> is still working for me. Can you share the body of the request you’re making?

0 Upvotes
jtosey
Member

Any update on this? We have the same issue. Can the “body” field include HTML? This isn’t mentioned in the documentation. Incidentally I think you meant <br />, not </ br>.

0 Upvotes
Derek_Gervais
HubSpot Employee

Hi @jtosey,

Either </br. or <br/> appear to function as a line break, based on my testing. Additionally, it appears that some light HTML markup is supported in NOTE engagements, but I’m not yet sure if that’s intentional or not. I wouldn’t recommend using HTML in NOTE engagements since it’s undocumented and may be subject to change. I’ll touch base with the product team on that.

0 Upvotes
Derek_Gervais
HubSpot Employee

Hi @jtosey,

I was able to confirm with the product team; HTML elements like anchor tags, header tags, and line breaks are supported in the note body. Anything more sophisticated than that (even if it works) is unsupported, and is subject to change without notice. In general, if you need more complex formatting you would likely be better served using the Timeline API.

0 Upvotes
abrice
Member

Is adding HTML elements to the "body" field still unsupported? If so, does this extend to engagements with type of "meeting" as well?

 

Thanks!

0 Upvotes
kevchen1
Member

Hi Derek - I wanted to check in on this again. I'm using a zapier integration to create engagements and using <b/> isn't working for that. Is there a new way of forcing a newline into the created Engagement (note)

0 Upvotes
HenryCipolla
Member

Kevchen, to be clear it's: <br/> (short for break) not <b/> (legacy bold tag)

 

One thing you could do is use the Engagements API and see what value is actually making its way into HubSpot's database in case Zapier is doing something clever like stripping HTML from you (although I've seen that use case work as expected in the past)

0 Upvotes
kevchen1
Member

Yup and that's why you don't do things at 3AM. Thanks Henry.

0 Upvotes