<?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: Converting to PrivateApp: &amp;quot;Authentication credentials not found.&amp;quot; - Using Powershell in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Converting-to-PrivateApp-quot-Authentication-credentials-not/m-p/720632#M58869</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/123777"&gt;@SeeOurBeach&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;LI-CODE lang="php"&gt;$headers = @{ 'Content-Type'='application/json'
    'Authorization'= 'Bearer ' + $PrivateAppKey
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;`&lt;SPAN&gt;Authorization: Basic XXXX` means basic auth.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;private app token is used by oauth2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so , it should set `Authorization: Bearer XXXX` in header.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Nov 2022 11:59:33 GMT</pubDate>
    <dc:creator>skimura</dc:creator>
    <dc:date>2022-11-19T11:59:33Z</dc:date>
    <item>
      <title>Converting to PrivateApp: "Authentication credentials not found." - Using Powershell</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Converting-to-PrivateApp-quot-Authentication-credentials-not/m-p/720461#M58848</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are working to convert our API scripts to use the PrivateApp. Set up the PrivateApp. Got the token key. Tried a simple call. Got the error message ""Authentication credentials not found. This API supports both API Key and OAuth 2.0 authentication".&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Looking over examples and documentation and cant figure out. Am I missing something obvious?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;$PrivateAppKey="....(not shown)....";&lt;/P&gt;&lt;P&gt;$url = "&lt;A href="https://api.hubapi.com/crm/v3/objects/contacts/123456789" target="_blank" rel="noopener"&gt;https://api.hubapi.com/crm/v3/objects/contacts/123456789&lt;/A&gt;"; # (obfuscated)&lt;/P&gt;&lt;P&gt;$headers = @{ 'Content-Type'='application/json'&lt;BR /&gt;'Authorization'= 'Basic ' + $PrivateAppKey&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$JSONStr='{"properties":[{"property":"Alink","value":"&lt;A href="https://www.someothersytsem.com" target="_blank" rel="noopener"&gt;https://www.someothersytsem.com&lt;/A&gt;"}]}';&lt;/P&gt;&lt;P&gt;$response = Invoke-WebRequest -Uri $url -UseBasicParsing -Body $JSONstr -Headers $Headers -Method 'PATCH';&lt;/P&gt;&lt;P&gt;#Methods that fail: UPDATE, POST, GET&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response:&lt;/P&gt;&lt;P&gt;{"status":"error","message":"Authentication credentials not found. This API supports both API Key and OAuth 2.0 authentication and you can find more details at&lt;BR /&gt;&lt;A href="https://developers.hubspot.com/docs/methods/auth/oauth-overview&amp;quot;,&amp;quot;correlationId&amp;quot;:&amp;quot;27ded0ae-876c-4383-8129-0b3c7b64a83f&amp;quot;,&amp;quot;category&amp;quot;:&amp;quot;INVALID_AUTHENTICATION&amp;quot;}" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/methods/auth/oauth-overview","correlationId":"27ded0ae-876c-4383-8129-0b3c7b64a83f","category":"INVALID_AUTHENTICATION"}&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 17:51:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Converting-to-PrivateApp-quot-Authentication-credentials-not/m-p/720461#M58848</guid>
      <dc:creator>SeeOurBeach</dc:creator>
      <dc:date>2022-11-18T17:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Converting to PrivateApp: "Authentication credentials not found." - Using Powershell</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Converting-to-PrivateApp-quot-Authentication-credentials-not/m-p/720632#M58869</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/123777"&gt;@SeeOurBeach&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;LI-CODE lang="php"&gt;$headers = @{ 'Content-Type'='application/json'
    'Authorization'= 'Bearer ' + $PrivateAppKey
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;`&lt;SPAN&gt;Authorization: Basic XXXX` means basic auth.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;private app token is used by oauth2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so , it should set `Authorization: Bearer XXXX` in header.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 11:59:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Converting-to-PrivateApp-quot-Authentication-credentials-not/m-p/720632#M58869</guid>
      <dc:creator>skimura</dc:creator>
      <dc:date>2022-11-19T11:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting to PrivateApp: "Authentication credentials not found." - Using Powershell</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Converting-to-PrivateApp-quot-Authentication-credentials-not/m-p/721029#M58906</link>
      <description>Perfect!&lt;BR /&gt;Thanks for that advice&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Nov 2022 16:06:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Converting-to-PrivateApp-quot-Authentication-credentials-not/m-p/721029#M58906</guid>
      <dc:creator>SeeOurBeach</dc:creator>
      <dc:date>2022-11-21T16:06:24Z</dc:date>
    </item>
  </channel>
</rss>

