Hi -
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”.
Looking over examples and documentation and cant figure out. Am I missing something obvious?
Code:
$PrivateAppKey=“…(not shown)…”;
$url = “https://api.hubapi.com/crm/v3/objects/contacts/123456789”; # (obfuscated)
$headers = @{ ‘Content-Type’=‘application/json’
‘Authorization’= 'Basic ’ + $PrivateAppKey
}
$JSONStr=‘{“properties”:[{“property”:“Alink”,“value”:“https://www.someothersytsem.com”}]}’;
$response = Invoke-WebRequest -Uri $url -UseBasicParsing -Body $JSONstr -Headers $Headers -Method ‘PATCH’;
#Methods that fail: UPDATE, POST, GET
Response:
{“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
https://developers.hubspot.com/docs/methods/auth/oauth-overview",“correlationId”:“27ded0ae-876c-4383-8129-0b3c7b64a83f”,“category”:“INVALID_AUTHENTICATION”}
Thanks!