Create List Mailwizz 2 API, I need a help with body

paweld

New Member
I would like to write a client in JAVA, but I have problem with this request which I send through plain curl (the example of the body I took from https://api-docs.mailwizz.com/#create-a-list )

POST mysite/api/index.php/lists/create
Content-Type: application/json; charset=utf-8
X-MW-PUBLIC-KEY: my_public_key

{
"general": {
"name": "My list created from the API",
"description": "This is a test list, created from the API."
},
"defaults": {
"from_name": "John Doe",
"from_email": "johndoe@doe.com",
"reply_to": "johndoe@doe.com",
"subject": "Hello!"
},
"notifications": {
"subscribe": "no",
"unsubscribe": "yes",
"subscribe_to": "johndoe@doe.com",
"unsubscribe_to": "johndoe@doe.com"
},
"company": {
"name": "John Doe INC",
"country": "United States",
"zone": "New York",
"address_1": "Some street address",
"address_2": "",
"zone_name": "",
"city": "New York City",
"zip_code": "10019"
}
}

But when I run this I get
422
{
"status": "error",
"error": {
"general": {
"name": "Name cannot be blank.",
"description": "Description cannot be blank."
}
}
}

What should be the proper body for the POST lists/create ?
 
Back
Top