I am trying to use the endpoint “messages” to send an email for a list of contacts
However looking at the documentation I didn’t get how to do.
I am using python and I’ve tried the following:
headers = {'Api-Token': ac_key,
"accept": "application/json",
"content-type": "application/json"}
url = f'{ac_url}/api/3/messages'
payload = {
"message": {
"fromname": "Clube da Aposta",
"fromemail": "[relacionamento@clubedaposta.com](mailto:relacionamento@clubedaposta.com)",
"reply2": "[relacionamento@clubedaposta.com](mailto:relacionamento@clubedaposta.com)",
"subject": "You are subscribing to %LISTNAME%",
"preheader_text": "Pre-header Text",
"text": "hello",
"html": "<div>hello</div>"
}
}
response = requests.post(url, headers=headers, json=payload)
As response I got this:
{‘message’: {‘fromname’: ‘Clube da Aposta’, ‘fromemail’: ‘relacionamento@clubedaposta.commailto:[relacionamento@clubedaposta.com](mailto:relacionamento@clubedaposta.com)’, ‘reply2’: ‘relacionamento@clubedaposta.commailto:[relacionamento@clubedaposta.com](mailto:relacionamento@clubedaposta.com)’, ‘subject’: ‘You are subscribing to %LISTNAME%’, ‘preheader_text’: ‘Pre-header Text’, ‘text’: ‘hello’, ‘html’: ‘
However looks like that no email was sent.
Do I have to set a parameter to indicate the users ids or lists to send the email?
I didn’t get how to do this. Can anyone help me?