<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Engagements returned with HTML tags in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/539486#M49340</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/246700"&gt;@OOneTalk_test&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What type of engagements are you retrieving? Depending on the 'TYPE' you have several ways to retrieve the &lt;A href="https://legacydocs.hubspot.com/docs/methods/engagements/engagements-overview" target="_blank" rel="noopener"&gt;plain text variant&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 10:50:08 GMT</pubDate>
    <dc:creator>Teun</dc:creator>
    <dc:date>2021-12-09T10:50:08Z</dc:date>
    <item>
      <title>Engagements returned with HTML tags</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/539447#M49336</link>
      <description>&lt;P&gt;Engagements have HTML tags in their response (e.g. Note body). Is there some parameter or maybe alternative endpoint where we would be able retrieve them without tags? It is just that parsing them on our side would spend considerable amount of resources.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 09:44:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/539447#M49336</guid>
      <dc:creator>OOneTalk_test</dc:creator>
      <dc:date>2021-12-09T09:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Engagements returned with HTML tags</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/539486#M49340</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/246700"&gt;@OOneTalk_test&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What type of engagements are you retrieving? Depending on the 'TYPE' you have several ways to retrieve the &lt;A href="https://legacydocs.hubspot.com/docs/methods/engagements/engagements-overview" target="_blank" rel="noopener"&gt;plain text variant&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 10:50:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/539486#M49340</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2021-12-09T10:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Engagements returned with HTML tags</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/539856#M49358</link>
      <description>&lt;P&gt;Hi Teun,&lt;/P&gt;&lt;P&gt;We are &lt;SPAN&gt;retrieving Notes, Tasks, Calls and also plan to retrieve Meetings in future (so basically we are interested in everything except for Emails).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 19:56:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/539856#M49358</guid>
      <dc:creator>OOneTalk_test</dc:creator>
      <dc:date>2021-12-09T19:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Engagements returned with HTML tags</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/540166#M49370</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/246700"&gt;@OOneTalk_test&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you retrieving &lt;A href="https://legacydocs.hubspot.com/docs/methods/engagements/get-all-engagements" target="_blank" rel="noopener"&gt;multiple engagements&lt;/A&gt;&amp;nbsp;or a &lt;A href="https://legacydocs.hubspot.com/docs/methods/engagements/get_engagement" target="_blank" rel="noopener"&gt;single engagement&lt;/A&gt; with each request?&lt;/P&gt;
&lt;P&gt;For each engagement type, you need to access the 'metadata' object that is part of each result. I'll describe how you can access the plain text for each engagement type:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Email:&lt;BR /&gt;&lt;/STRONG&gt;The plain text variant is available in the &lt;STRONG&gt;metadata.text&lt;/STRONG&gt; object:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"metadata": {
    "from": {
        "email": "",
        "firstName": "",
        "lastName": ""
    },
    "to": [
        {
            "email": ""
        }
    ],
    "cc": [],
    "bcc": [],
    "sender": {},
    "subject": "",
    "html": "",
    "text": "",
    "trackerKey": "",
    "emailSendEventId": {},
    "validationSkipped": [],
    "pendingInlineImageIds": []
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Notes:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The plain text version is available in the metadata.body object:&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"metadata": {
    "body": ""
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Calls:&lt;BR /&gt;&lt;/STRONG&gt;This result does not have a plain text version available in the metadata object. However, if the&amp;nbsp;&lt;STRONG&gt;bodyPreviewIsTruncated&amp;nbsp;&lt;/STRONG&gt;value is false, you could use the&amp;nbsp;&lt;STRONG&gt;bodyPreview&lt;/STRONG&gt;:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
    "engagement": {
        "id": 0,
        "portalId": 0,
        "active": true,
        "createdAt": 0,
        "lastUpdated": 0,
        "createdBy": 0,
        "modifiedBy": 0,
        "ownerId": 0,
        "type": "CALL",
        "timestamp": 0,
        "teamId": 0,
        "activityType": "",
        "allAccessibleTeamIds": [],
        "bodyPreview": "",
        "queueMembershipIds": [],
        "bodyPreviewIsTruncated": false,
        "bodyPreviewHtml": ""
    },
    "associations": {
        "contactIds": [],
        "companyIds": [],
        "dealIds": [],
        "ownerIds": [],
        "workflowIds": [],
        "ticketIds": [],
        "contentIds": [],
        "quoteIds": []
    },
    "attachments": [],
    "metadata": {
        "toNumber": "",
        "fromNumber": "",
        "status": "COMPLETED",
        "externalId": "",
        "durationMilliseconds": 0,
        "externalAccountId": "",
        "body": "",
        "disposition": "",
        "calleeObjectType": "",
        "calleeObjectId": ,
        "title": "",
        "source": "",
        "callsServiceCallId": 0
    }
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Tasks:&lt;BR /&gt;&lt;/STRONG&gt;The same applies for tasks. There is no plain text version available, but if &lt;STRONG&gt;bodyPreviewIsTruncated&lt;/STRONG&gt; is false, you can use the &lt;STRONG&gt;bodyPreview&lt;/STRONG&gt;:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  "metadata": {
    "body": "",
    "status": "COMPLETED",
    "forObjectType": "OWNER",
    "subject": "",
    "taskType": "TODO",
    "reminders": [],
    "sendDefaultReminder": true,
    "priority": "NONE",
    "isAllDay": false,
    "completionDate": 0
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Meeting:&lt;BR /&gt;&lt;/STRONG&gt;You can access the plain text version in the metadata.body:&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  "metadata": {
    "startTime": 0,
    "endTime": 0,
    "title": "",
    "body": "",
    "preMeetingProspectReminders": []
  }&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;I could be mistaken here, but it is possible to retrieve the plain text version for each engagement type except calls and tasks. If the &lt;STRONG&gt;bodyPreviewIsTruncated&lt;/STRONG&gt; you can use the &lt;STRONG&gt;bodyPreview&amp;nbsp;&lt;/STRONG&gt;but if that one is set to true, you would still need some 'striptags' functionality in your code.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 07:34:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/540166#M49370</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2021-12-10T07:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Engagements returned with HTML tags</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/540413#M49388</link>
      <description>&lt;P&gt;Thank you! Works great.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 16:57:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Engagements-returned-with-HTML-tags/m-p/540413#M49388</guid>
      <dc:creator>OOneTalk_test</dc:creator>
      <dc:date>2021-12-10T16:57:45Z</dc:date>
    </item>
  </channel>
</rss>

