Reputation: 3484
I am currently testing Mailgun. Therefore, I don't want to add any payment information at the moment.
So, I'm working with the sandbox, and a verified address in the authorized recipients attached to the sandbox. So far, following the documentation, this limited setup is supposed to be working for testing purpose.
I use Postman to better identify how to work with the API, excluding any potential issues with coding.
Here is my Hello World config:
POST https://api:[email protected]/v3/sandboxXXXXX.mailgun.org/messages
The dashboard indicates that the sandbox is located in the US, so I don't use the european API.
Body:
I get a 400 error, Bad Request, and the documentation suggests to look for missing parameters.
The other posts I found so far did not help me to find the error spot either.
Also, Mailgun provides a Postman collection. But it did not help either.
Indeed, I dream of a detailed information of the API requirements, value formating... What are the required parameters if the error means I miss some?
Any idea of what I am missing?
Upvotes: 2
Views: 2248
Reputation: 3484
Here is the solution.
I had to guess and analyze some examples from the provided Postman Collection to find out what the documentation is supposed to explain in the first place:
Value : Basic XXXXX
, where XXXXX is the Base 64 encoded version of api:___your_API_key___
.
Value : multipart/form-data; boundary=XXX
, where XXX is any short single string that will be used to identify a boundary within the sent content.
Value : XXX
, where XXX is the size of the body request.
Value : mydomain.com
, your IP if sending from Postman...
Upvotes: 0