https://api.hubapi.com/automation/v4/actions/ and oAuth2

Hello !

I cannot success to use oAuth2 with https://api.hubapi.com/automation/v4/actions/.

I can get token with

curl “https://api.hubapi.com/oauth/v1/token/” …

I can use token, by example :

curl --header “Authorization: Bearer CLfZyarjM” https://api.hubapi.com/contacts/v1/lists/all/contacts/all\?count\=1

I CANNOT use this token to get actions :

curl --header “Authorization: Bearer CLfZya…” https://api.hubapi.com/automation/v4/actions/1421444

{“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”:“242eb07b-4916-4ef3-b658-e3770441b960”,“category”:“INVALID_AUTHENTICATION”}

Same call with Hapikey works

curl "https://api.hubapi.com/automation/v4/actions/1421444?hapikey=eu…

"{“results”:[]}

Strange No ?

Another information : Accidentally I have tried with an old token and I received message that tells that it had expired

curl --header "Authorization: Bearer CJfqp… " https://api.hubapi.com/automation/v4/actions/1421444
{“status”:“error”,“message”:“The OAuth token used to make this call expired 13 minute(s) ago.”,“correlationId”:“3d0fdcd0-34ef-425a-a92f-462ca2374092”,“category”:“EXPIRED_AUTHENTICATION”,“context”:{“expire time”:[“2023-02-09T07:53:07.607Z”]}}

Any idea ? It looks like a bug … confirm ?

Hi, @JCOGNET :waving_hand: To confirm, you are using the endpoints listed here — Custom Workflow Actions? If so, most of the endpoints on that page only work with a Developer API key and not with OAuth or a Private App.

To help anyone else who finds this post, you can find your Developer API Key in your Developer Portal. It will have a banner at the top stating “This is an app developer account.” From there, you click Apps > Get HubSpot API key.

If you are using a different endpoint, please link it here for the community.

Best,

Jaycee

Hello,
It’s not working for me and not working with : personal dev key, dev key, oauth2…
So bad the lack of informations about it…
Edit: found
You need to use dev api key as
https://api.hubapi.com/automation/v4/actions/APPID?hapikey=XXXX