Hi, I am integrating Mailwizz with our Python/Django based backend. I have a simple/basic python library to do API calls on Mailwizz. Currently I can get lists and add a subscriber via the mailwizz api however I'm stuck on implementing the create campaign via the api.
My api call will be as follows, an HTTP POST with the post body:
See: https://api-docs.mailwizz.com/#campaigns
POST https://www.example.com/api/index.php/campaigns
{
"name": "Test Campaign",
"from_name": "Test",
"from_email": "test@example.com",
"subject": "Test",
"reply_to": "test@example.com",
"list_uid": "list-id",
"send_at": "2019-03-22T07:54:42.325383+00:00",
"template": {
"template_id": "template-id"
}
}
And here is the response:
Status code: 422
{'status': 'error', 'error': {'name': 'Campaign name cannot be blank.', 'from_name': 'From name cannot be blank.', 'from_email': 'From email cannot be blank.', 'subject': 'Subject cannot be blank.', 'reply_to': 'Reply to cannot be blank.'}}
But It seems like Mailwizz campaign api cant read the post body. My HTTP headers I believe is correct since I can successfully call get lists and add subscriber api endpoint. I assume that the post data above are not correct? Any advice.
My api call will be as follows, an HTTP POST with the post body:
See: https://api-docs.mailwizz.com/#campaigns
POST https://www.example.com/api/index.php/campaigns
{
"name": "Test Campaign",
"from_name": "Test",
"from_email": "test@example.com",
"subject": "Test",
"reply_to": "test@example.com",
"list_uid": "list-id",
"send_at": "2019-03-22T07:54:42.325383+00:00",
"template": {
"template_id": "template-id"
}
}
And here is the response:
Status code: 422
{'status': 'error', 'error': {'name': 'Campaign name cannot be blank.', 'from_name': 'From name cannot be blank.', 'from_email': 'From email cannot be blank.', 'subject': 'Subject cannot be blank.', 'reply_to': 'Reply to cannot be blank.'}}
But It seems like Mailwizz campaign api cant read the post body. My HTTP headers I believe is correct since I can successfully call get lists and add subscriber api endpoint. I assume that the post data above are not correct? Any advice.