APIs & Integrations

COtani
Member

Single Send API - ERROR "Could not find email"

SOLVE

I’m having some issues with the single send api:

https://developers.hubspot.com/docs/api/marketing/single-send-api

 

This is the resonse error message:

 

 

<Response [400]>

{'status': 'error', 'message': 'Could not find email -- portalId: 7222820, emailId: 168327023110', 'correlationId': 'a792e01a-ed3e-4dac-a06d-616618bdfa4b', 'sendResult': 'MISSING_CONTENT'}

 

 

 

It looks like the email_id is wrong. I copied it from the URL of the template email:

https://app.hubspot.com/design-manager/7222820/code/168327023110

 

I set up a very basic template and am trying to send it to myself. Here is the python code:

 

 

import requests



auth_token = ******

email_id = 168327023110

url = 'https://api.hubapi.com/marketing/v4/email/single-send'



data = {

    "emailId": email_id,

    "message": {"to": "redacted@redacted.com", }

}

headers = {'Authorization': f'Bearer {auth_token}',

           'Content-Type': 'application/json'}

response = requests.post(url,  json=data, headers=headers)

 

 

 

template:

COtani_1-1716500302086.png

 

I also tried the CURL example with my email ID and am getting the same response.

0 Upvotes
1 Accepted solution
AHernández60
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

Single Send API - ERROR "Could not find email"

SOLVE

Hello!

 

It is possible that your error is because you are providing the template ID and not an email ID.

Try creating a new email using this template and once designed, save it as a one-time email (in the actions within the editor).

If you need any additional screenshots or help, don't hesitate to contact me.
Also you can contact me here.

Regards

View solution in original post

3 Replies 3
AHernández60
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

Single Send API - ERROR "Could not find email"

SOLVE

Hello!

 

It is possible that your error is because you are providing the template ID and not an email ID.

Try creating a new email using this template and once designed, save it as a one-time email (in the actions within the editor).

If you need any additional screenshots or help, don't hesitate to contact me.
Also you can contact me here.

Regards

COtani
Member

Single Send API - ERROR "Could not find email"

SOLVE

Thnk you. That was the main issue. There is also an action to convert the email to single-send which was also needed.  

 

COtani_0-1716582354786.png

 

0 Upvotes
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Single Send API - ERROR "Could not find email"

SOLVE

This is indeed the correct answer. 

 

Schermafbeelding 2024-05-24 om 21.58.34.png



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes