We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Jan 25, 2022 6:24 AM
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.
Jan 26, 2022 3:24 PM
Do you have the transactional email addon added to your portal?
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |