APIs & Integrations

davidsd
Membre

SMTP Token Transactional Mail INVALID_AUTHENTICATION

I'm trying to get an SMTP Token via the /marketing/v3/transactional/smtp-tokens endpoint (POST method).

 

I'm following the API guide -> https://developers.hubspot.com/docs/api/marketing/transactional-emails

 

The documentation says I can use a hapikey in order to do the petition, but when trying the example provided with my hapikey:

 

curl --request POST \
--url 'https://api.hubapi.com/marketing/v3/transactional/smtp-tokens?hapikey=MYHAPIKEY' \
--header 'content-type: application/json' \
--data '{
"createContact": true,
"campaignName": "string"
}'

 

I'm receiving a 401 error, that confuses me (as it says that I could use both API Key or Oauth, but doesn't seem to be real):

 

{
"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": "4afc9b20-4fa3-49f8-b1d2-8a881c62de53",
"category": "INVALID_AUTHENTICATION"
}

 

Could this be because I need to use Oauth? It would be a real pain to not be able to use the API Key on those requests.

0 Votes
1 Réponse
dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

SMTP Token Transactional Mail INVALID_AUTHENTICATION

@davidsd 

Do you have the transactional email addon added to your portal?

0 Votes