Different authentication for custom events & templates API
For testing purposes, I did added ALL possible scopes to my private app without success.
Here is the exact error message:
HTTP response body: {"status":"error","message":"Any of the listed authentication credentials are missing","correlationId":"bcbc6e7b-9d7e-4ee2-839f-b0e9374e29bc","engagement":{"hapikey":"hapikey not engaged. hapikey is not present in query params.","service-to-service":"service-to-service not engaged. Metadata for service-to-service request not found.","oauth-token":"oauth-token not engaged. OAuth access token not found in request header.","app-cookie":"app-cookie not engaged. App cookie is not present on the request.","internal-cookie":"internal-auth not engaged. You can get a new internal auth cookie for host 'api.hubapi.com' by visiting following link from your current browser window: https://tools.hubteam.com/login/host/api.hubapi.com ."}}
developer API keys and private app access tokens cannot be used as authentication when creating events. To create an event, the associated HubSpot account needs to grant access to your app via OAuth. Once you receive an OAuth access token, you can use it to add events to the account.
But in order to grant access to you app, we need an API key, this is what your documentation is saying about it:
Please note: as of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Instead, you'll need to authenticate using a private app access token or OAuth.
And when selecting the appropriate private app timeline scope, it says:
Create timeline events - Grants access to manage custom activities on HubSpot CRM records. This includes creating or updating records.
So how can I easily create a custom event template using the API? Why should I ever use OAuth? And what this is about grant access to a private app? The documentation is really cryptic.
Could you give me a clear & tested example of how to create custom event template?