<?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 Migrating from API Key to Private App with VIDs in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/704987#M57761</link>
    <description>&lt;P&gt;In our existing API Key setup, we have these URLs to determine if we need to do an ADD or an UPDATE based on a match on the &lt;STRONG&gt;vid&lt;/STRONG&gt;:&lt;BR /&gt;&lt;A href="https://api.hubapi.com/contacts/v1/contact/vid/XXXX/profile?hapikey=XXXX" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.hubapi.com/contacts/v1/contact/vid/XXXX/profile?hapikey=XXXX&lt;/A&gt;;&lt;BR /&gt;&lt;BR /&gt;How would I accomplish the same in the Private App setup, which references v3?&lt;BR /&gt;&lt;A href="https://api.hubapi.com/crm/v3/objects/contacts" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.hubapi.com/crm/v3/objects/contacts&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2022 16:04:50 GMT</pubDate>
    <dc:creator>MJProvencher</dc:creator>
    <dc:date>2022-10-12T16:04:50Z</dc:date>
    <item>
      <title>Migrating from API Key to Private App with VIDs</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/704987#M57761</link>
      <description>&lt;P&gt;In our existing API Key setup, we have these URLs to determine if we need to do an ADD or an UPDATE based on a match on the &lt;STRONG&gt;vid&lt;/STRONG&gt;:&lt;BR /&gt;&lt;A href="https://api.hubapi.com/contacts/v1/contact/vid/XXXX/profile?hapikey=XXXX" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.hubapi.com/contacts/v1/contact/vid/XXXX/profile?hapikey=XXXX&lt;/A&gt;;&lt;BR /&gt;&lt;BR /&gt;How would I accomplish the same in the Private App setup, which references v3?&lt;BR /&gt;&lt;A href="https://api.hubapi.com/crm/v3/objects/contacts" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.hubapi.com/crm/v3/objects/contacts&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 16:04:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/704987#M57761</guid>
      <dc:creator>MJProvencher</dc:creator>
      <dc:date>2022-10-12T16:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating from API Key to Private App with VIDs</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/705311#M57781</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hey &lt;A href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/379041" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/460653" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;MJProvencher&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hey there it feels like you still need rely on V1&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Still you can have a look at the below link - &amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/API-for-contacts-v1-contact-vid-vid-profile-in-V3/m-p/413688" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;https://community.hubspot.com/t5/APIs-Integrations/API-for-contacts-v1-contact-vid-vid-profile-in-V3/m-p/413688&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Regarding the migration -&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI aria-level="1"&gt;&lt;STRONG&gt;&lt;STRONG&gt;Go to you settings console on your hubspot account&lt;/STRONG&gt;&lt;/STRONG&gt;
&lt;UL&gt;
&lt;LI aria-level="1"&gt;&lt;STRONG&gt;&lt;STRONG&gt;Create a new private app for contacts&lt;/STRONG&gt;&lt;/STRONG&gt;
&lt;UL&gt;
&lt;LI aria-level="1"&gt;&lt;STRONG&gt;&lt;STRONG&gt;Define the scope&amp;nbsp;&lt;/STRONG&gt;&lt;/STRONG&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Check the contact scopes from here -&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/api/crm/contacts" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;https://developers.hubspot.com/docs/api/crm/contacts&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Check the below image -&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChehakWadhdwa_0-1665651927074.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/77083i8F819023CC2A7DF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChehakWadhdwa_0-1665651927074.png" alt="ChehakWadhdwa_0-1665651927074.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If we were able to answer your query, kindly help the community by marking it as a solution.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks and Regards.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 13 Oct 2022 09:07:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/705311#M57781</guid>
      <dc:creator>ChehakWadhdwa</dc:creator>
      <dc:date>2022-10-13T09:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating from API Key to Private App with VIDs</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/705660#M57801</link>
      <description>&lt;P&gt;Thanks for the reply—I think for developers more experienced, your response likely was a helpful solution.&lt;BR /&gt;&lt;BR /&gt;Let me try to simplify my noob question:&lt;BR /&gt;&lt;BR /&gt;Since I'm adding the access_token to the header with `Authorization: Bearer`, can I simply remove the hapikey param from these existing links, turning this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$url = 'https://api.hubapi.com/contacts/v1/contact?hapikey=' . $api_key;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; into&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$url = 'https://api.hubapi.com/contacts/v1/contact';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(in essence, leaving the rest of the implementation in place, since after passing the access_token in the headers, that handles the authentication?)&lt;BR /&gt;&lt;BR /&gt;Again, sorry if these are super basic questions!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 20:19:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/705660#M57801</guid>
      <dc:creator>MJProvencher</dc:creator>
      <dc:date>2022-10-13T20:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating from API Key to Private App with VIDs</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/705753#M57804</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hey&amp;nbsp; &lt;/SPAN&gt;&lt;A href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/379041" target="_blank"&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/460653" target="_blank"&gt;&lt;SPAN&gt;MJProvencher&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yes, you can remove hapikey param from these existing links as these will be of no use from 1 December 2022 according to new privacy &amp;amp; policy changes of hubspot. All endpoints will rely on Private Apps that are the Authorization Bearer tokens.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If we were able to answer your query, kindly help the community by marking it as a solution.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks and Regards.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 06:18:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/705753#M57804</guid>
      <dc:creator>ChehakWadhdwa</dc:creator>
      <dc:date>2022-10-14T06:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating from API Key to Private App with VIDs</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/720497#M58857</link>
      <description>&lt;P&gt;In case it helps, this is a summary of what I needed to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;define('HS_PRIVATE_APP_TOKEN', 'XXXXXX'); // added

$header = array(
	'Content-Type: application/json', // existing
	'Accept: application/json', // existing
	'Authorization: Bearer ' . HS_PRIVATE_APP_TOKEN  // needed to be added everywhere
);

// removed the following:
// $url = 'https://api.hubapi.com/companies/v2/companies/paged?hapikey='.$api_key.$properties.'&amp;amp;limit=200'.$hs_offset;

// added this modified declaration, removing the $api_key param
$url = 'https://api.hubapi.com/companies/v2/companies/paged?limit=200'.$properties.$hs_offset;

// and this was existing as well
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);	&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Nov 2022 19:13:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Migrating-from-API-Key-to-Private-App-with-VIDs/m-p/720497#M58857</guid>
      <dc:creator>MJProvencher</dc:creator>
      <dc:date>2022-11-18T19:13:02Z</dc:date>
    </item>
  </channel>
</rss>

