<?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: Creating a call engagement from Twilio to Hubspot in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272663#M24749</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/8642"&gt;@taropaa&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy to clarify! I've addressed your questions below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. HubSpot will&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; automatically associate&amp;nbsp;&lt;CODE&gt;CALL&lt;/CODE&gt; engagements with contacts by the&amp;nbsp;&lt;CODE&gt;toNumber&lt;/CODE&gt; value in the &lt;CODE&gt;metadata&lt;/CODE&gt; object. As when &lt;A href="https://developers.hubspot.com/docs/methods/engagements/create_engagement" target="_self"&gt;creating other types of engagements&lt;/A&gt;, you must include the&amp;nbsp;&lt;CODE&gt;associations&lt;/CODE&gt;&amp;nbsp;object and list the desired contact &lt;CODE&gt;vid&lt;/CODE&gt;s in the &lt;CODE&gt;contactIds&lt;/CODE&gt; array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, you can pass phone number values in any format to the &lt;CODE&gt;toNumber&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE&gt;fromNumber&lt;/CODE&gt;&amp;nbsp;fields. HubSpot will display whatever you send on the contact timeline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. The&amp;nbsp;&lt;CODE&gt;externalId&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE&gt;&lt;SPAN class="token string"&gt;externalAccountId&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;fields are actually defined on the &lt;A href="https://developers.hubspot.com/docs/methods/engagements/engagements-overview" target="_self"&gt;Engagements Overview&lt;/A&gt; page:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;externalId&lt;/CODE&gt;&amp;nbsp;is a string for calls made in HubSpot. It is not used for engagements created through the API.&lt;/LI&gt;
&lt;LI&gt;Similarly,&amp;nbsp;&lt;CODE&gt;externalAccountId&lt;/CODE&gt;&amp;nbsp;is also used for calls made in HubSpot and has no bearing on API-generated calls.&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Thu, 30 May 2019 14:33:50 GMT</pubDate>
    <dc:creator>IsaacTakushi</dc:creator>
    <dc:date>2019-05-30T14:33:50Z</dc:date>
    <item>
      <title>Creating a call engagement from Twilio to Hubspot</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272128#M24672</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a new call engagement from a quite complicated Twilio flow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, I am trying to send an HTTP Request to the API as referred to here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/methods/engagements/create_engagement" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/methods/engagements/create_engagement&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two issues:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue 1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am not sure if I can just send the phone number and HubSpot will be able to automatically associate the call to a contact based on the phone number. Will the format matter? (IE if I have +1 (999) 999-999 stored in the contact's phone number, will +19999999999 match?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue 2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am not sure what the&amp;nbsp;&lt;STRONG&gt;&lt;SPAN class="token string"&gt;externalId&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;and the&amp;nbsp;&lt;STRONG&gt;&lt;SPAN class="token string"&gt;externalAccountId&lt;/SPAN&gt;&lt;/STRONG&gt; stand for. Do they have to be a specific format? Do they need to match anything in my HubSpot account?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Currently, my request looks like this:&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;{
    "engagement": {
        "active": true,
        "ownerId": 1,
        "type": "CALL",
        "timestamp": 1409172644778
    },
    "metadata" : {
        "toNumber" : "5618769964",
        "fromNumber" : "(857) 829-5489",
        "status" : "COMPLETED",
        "externalId" : "CAc052aca6842211ab1c548dcfed5c9",
        "durationMilliseconds" : 38000,
        "externalAccountId" : "AC890b8e6fbebd59158e26046a8dde",
        "recordingUrl" : "{{widgets.connect_call_1.RecordingUrl}} ",
        "body" : "A call was received and logged"
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank you,&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 15:15:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272128#M24672</guid>
      <dc:creator>taropaa</dc:creator>
      <dc:date>2019-05-27T15:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a call engagement from Twilio to Hubspot</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272663#M24749</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/8642"&gt;@taropaa&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy to clarify! I've addressed your questions below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. HubSpot will&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; automatically associate&amp;nbsp;&lt;CODE&gt;CALL&lt;/CODE&gt; engagements with contacts by the&amp;nbsp;&lt;CODE&gt;toNumber&lt;/CODE&gt; value in the &lt;CODE&gt;metadata&lt;/CODE&gt; object. As when &lt;A href="https://developers.hubspot.com/docs/methods/engagements/create_engagement" target="_self"&gt;creating other types of engagements&lt;/A&gt;, you must include the&amp;nbsp;&lt;CODE&gt;associations&lt;/CODE&gt;&amp;nbsp;object and list the desired contact &lt;CODE&gt;vid&lt;/CODE&gt;s in the &lt;CODE&gt;contactIds&lt;/CODE&gt; array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, you can pass phone number values in any format to the &lt;CODE&gt;toNumber&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE&gt;fromNumber&lt;/CODE&gt;&amp;nbsp;fields. HubSpot will display whatever you send on the contact timeline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. The&amp;nbsp;&lt;CODE&gt;externalId&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE&gt;&lt;SPAN class="token string"&gt;externalAccountId&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;fields are actually defined on the &lt;A href="https://developers.hubspot.com/docs/methods/engagements/engagements-overview" target="_self"&gt;Engagements Overview&lt;/A&gt; page:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;externalId&lt;/CODE&gt;&amp;nbsp;is a string for calls made in HubSpot. It is not used for engagements created through the API.&lt;/LI&gt;
&lt;LI&gt;Similarly,&amp;nbsp;&lt;CODE&gt;externalAccountId&lt;/CODE&gt;&amp;nbsp;is also used for calls made in HubSpot and has no bearing on API-generated calls.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 30 May 2019 14:33:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272663#M24749</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-05-30T14:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a call engagement from Twilio to Hubspot</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272672#M24753</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;&amp;nbsp;Thank you for your input.&lt;BR /&gt;I ended up querying the contacts database by the incoming phone number which allowed me to match them.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the workflow that worked for me using Twilio Studio:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Query Hubspot based on the phone number (the number stored in Hubspot must not include any spaces, dashes or parentheses and needs to include the area code similar to how Twilio would show it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://api.hubapi.com/contacts/v1/search/query?q={{trigger.call.From}}&amp;amp;hapikey=demo&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Once the results are returned (if any), I check that there is only one result and if so, I save the VID along with their first name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Using the VID I create a new engagement and associate it to the contact. I also attach the recording to the body of the engagement. Sadly there is no way to attach it to the dedicated&amp;nbsp;&lt;STRONG&gt;recordingURL&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;That did the trick!&amp;nbsp;This is really useful, as I have a complex flow going through different offices based on time of day and other caller attributes.&lt;BR /&gt;&lt;BR /&gt;I was however surprised at how limited the search function is. It only searches the phone number of contacts, and only the phone number, not the mobile number. Which is weird since the mobile number is the one that is most likely to be unique. I did find an open suggestion for this here:&amp;nbsp;&lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/Search-by-phone-number-should-apply-to-Company/idi-p/22630" target="_blank" rel="noopener"&gt;https://community.hubspot.com/t5/HubSpot-Ideas/Search-by-phone-number-should-apply-to-Company/idi-p/22630.&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this can help point the way for others trying to integrate Twilio with Hubspot to create personalized phone experiences.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 15:17:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272672#M24753</guid>
      <dc:creator>taropaa</dc:creator>
      <dc:date>2019-05-30T15:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a call engagement from Twilio to Hubspot</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272688#M24756</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/8642"&gt;@taropaa&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for sharing your solution!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To clarify, did you encounter issues defining a file URL in the &lt;CODE&gt;recordingUrl&lt;/CODE&gt; field? When I last tested that functionality, I could get it to work on the contact record.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have heard other developers express pain around searching contacts by phone number&amp;nbsp;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://community.hubspot.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; I'll continue to pass this feedback along internally.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 16:16:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272688#M24756</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-05-30T16:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a call engagement from Twilio to Hubspot</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272725#M24759</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried passing in an URL to the&amp;nbsp;&lt;SPAN&gt;recordingUrl field, but no recording appeared anywhere on the call. I resorted to just paste the recording URL as a link into the body of the call.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 20:26:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272725#M24759</guid>
      <dc:creator>taropaa</dc:creator>
      <dc:date>2019-05-30T20:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a call engagement from Twilio to Hubspot</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272926#M24792</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/8642"&gt;@taropaa&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you like, I'm happy to take a closer look. Could you direct message me with an example request you made that failed to populate a recording on the timeline?&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 18:27:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-a-call-engagement-from-Twilio-to-Hubspot/m-p/272926#M24792</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-05-31T18:27:38Z</dc:date>
    </item>
  </channel>
</rss>

