# Injecting HTML into a Engagement Task though the API

**URL:** <https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [February 3, 2021, 11:17pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241 "2021-02-03T23:17:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BryanHomey](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bryanhomey/32/68963_2.png) [@BryanHomey](https://community.hubspot.com/u/BryanHomey)\
**Post date:** [February 3, 2021, 11:17pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241/1 "2021-02-03T23:17:35Z")

</div>

All:

Has anyone been able to inject HTML into a Task’s Body through the Engagement API? I’d like to have a nice table for the user… Any thoughts on this? So far, I’ve put some in, using the /" for quotes, but the table is really wonky. Once they get into the Body then the formatting goes away. Any other ideas on how to put a table in?

Thanks!

Bryan

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 5, 2021, 4:33pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241/2 "2021-02-05T16:33:34Z")

</div>

Hey @BryanHomey

I am surprised you got that far! I totallu see the value, but I am not if it is possible.

This is one of those questions that I like to get @piersg and @jpsanchez 's 👀 on.

They are the type of people who say things like “OK, this may sound crazy, but it just might work”

---

<div class="post-metadata">

**Author:** ![BryanHomey](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bryanhomey/32/68963_2.png) [@BryanHomey](https://community.hubspot.com/u/BryanHomey)\
**Post date:** [February 5, 2021, 4:37pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241/3 "2021-02-05T16:37:35Z")

</div>

Thanks @dennisedson ! I dummed down the table, took out the formatting and was able to get an acceptable table in there. Sometimes… errr -- all the time, KISS works.

Thanks,

Bryan

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 5, 2021, 4:38pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241/4 "2021-02-05T16:38:56Z")

</div>

I love when I am proven wrong 🙂 Would be cool if you posted your working code so others can see and you can wow @piersg and @jpsanchez

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [February 5, 2021, 4:39pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241/5 "2021-02-05T16:39:46Z")

</div>

I love to be wowed 🙂

---

<div class="post-metadata">

**Author:** ![BryanHomey](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bryanhomey/32/68963_2.png) [@BryanHomey](https://community.hubspot.com/u/BryanHomey)\
**Post date:** [February 5, 2021, 5:07pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241/6 "2021-02-05T17:07:31Z")

</div>

Well -- @piersg @dennisedson Prepare to be underwhelmed!

Here is the JSON creating a Task through the Engagements API. I used a SQL Script to pull data and create it.

{ “engagement”: { “active”: “true”,

“ownerId”: BLUR,

“type”: “TASK”,

“timestamp”: 1615049235000,

“bodyPreview”: “Black Line Report Task”,

“bodyPreviewHtml”: “\<html\>\n \<head\>\</head\>\n \<body\>\n \<p\>Black Line Report Task\</p\>\n \</body\>\n\</html\>”

},

“associations”: {

“contactIds”: [],

“companyIds”: [BLUR],

“dealIds”: [], “ownerIds”: [] },

“metadata”: { “body”: “\<table\> \<tr\> \<th\>Customer Information\</th\> \</tr\> \<tr\>\<td\>LY12MM:\ \</td\> \<td\>$100.00\</td\>\</tr\> \<tr\>\<td\>CY12MM:\ \</td\> \<td\>$106.00\</td\>\</tr\> \<tr\>\<td\>Up!::\ \</td\> \<td\>$6.00\</td\>\</tr\> \<tr\>\<td\>UP Percentage!!:\ \</td\> \<td\>6.00%\</td\>\</tr\> \</table\>”,

“status”: “NOT\_STARTED”,

“forObjectType”: “OWNER”,

“subject”: “Black Line Call List”,

“taskType”: “CALL”,

“reminders”: [1613753235000],

“priority”: “HIGH” } }

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 5, 2021, 5:09pm UTC](https://community.hubspot.com/t/injecting-html-into-a-engagement-task-though-the-api/31241/7 "2021-02-05T17:09:25Z")

</div>

That table!

I know an outlook client that would be drooling if it saw that 😝
