APIs & Integrations

BryanHomey
Participant

Injecting HTML into a Engagement Task though the API

SOLVE

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

0 Upvotes
1 Accepted solution
BryanHomey
Solution
Participant

Injecting HTML into a Engagement Task though the API

SOLVE

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:&emsp;</td> <td>$100.00</td></tr> <tr><td>CY12MM:&emsp;</td> <td>$106.00</td></tr> <tr><td>Up!::&emsp;</td> <td>$6.00</td></tr> <tr><td>UP Percentage!!:&emsp;</td> <td>6.00%</td></tr> </table>",

"status": "NOT_STARTED",

"forObjectType": "OWNER",

"subject": "Black Line Call List",

"taskType": "CALL",

"reminders": [ 1613753235000 ],

"priority": "HIGH" } }

View solution in original post

6 Replies 6
BryanHomey
Solution
Participant

Injecting HTML into a Engagement Task though the API

SOLVE

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:&emsp;</td> <td>$100.00</td></tr> <tr><td>CY12MM:&emsp;</td> <td>$106.00</td></tr> <tr><td>Up!::&emsp;</td> <td>$6.00</td></tr> <tr><td>UP Percentage!!:&emsp;</td> <td>6.00%</td></tr> </table>",

"status": "NOT_STARTED",

"forObjectType": "OWNER",

"subject": "Black Line Call List",

"taskType": "CALL",

"reminders": [ 1613753235000 ],

"priority": "HIGH" } }

dennisedson
HubSpot Product Team
HubSpot Product Team

Injecting HTML into a Engagement Task though the API

SOLVE

That table! 

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


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Injecting HTML into a Engagement Task though the API

SOLVE

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"


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.

BryanHomey
Participant

Injecting HTML into a Engagement Task though the API

SOLVE

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

dennisedson
HubSpot Product Team
HubSpot Product Team

Injecting HTML into a Engagement Task though the API

SOLVE
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

HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.

piersg
Key Advisor

Injecting HTML into a Engagement Task though the API

SOLVE

I love to be wowed 🙂