Mailgun API Error

Hello Fellow Bubbler’s,

I’m trying to setup a Mailgun APi for Sending Email. I’ve followed the documentation and I’m getting the error: The API call returns a non-object and you picked JSON. Please check.

Anyone has an idea?

You have set the Data Type of the response to JSON and seem that is not a json that is returned.

I also think that your endpoint is not correct. I guess you are sending a message. So you need to have /message at the end of url

1 Like

I’m getting an error that it’s forbidden. Should be the IP address value. Anyone knows which IP I should add?

I also think that mailgun API use url parameter and not json. Try removing the content type header

I removed the content type. According to the documentation they are using Json. Right now the json error is gone, it’s displaying a forbidden error. Seems to be the key not validating. Same error happens also when I leave the key empty.

I created a Support Ticket on Mailgun. Waiting for a reply.

According to mailgun API, they use parameter and not json. They return json. (-F also mean normally that it’s send using Content-Type multipart/form-data . I was thinking this was only for .mime, but according to doc, this seem to be all call. But maybe they doesn’t take a chance and put it everywhere even if the url encoded may work)
Also, mailgun API have a different endpoint if you are in Eu. Did you check that?

2 Likes

Thanks, I made the adjustments. The issue with the Rejectection is from the Bubble IP. I’m not sure which IP to add. I got a reply from their technical staff.

Thank you for contacting Mailgun support.

Since there are 2 IPs in the whitelist for your account, only these two IPs are allowed to submit API requests or else the requests are rejected:

54.69.164.32
52.27.52.123

Regards,
Jeff | Mailgun Support

1 Like

Just got a new reply. I will try to see if it works after adding below IP’s.

Thank you for contacting Mailgun support. We are seeing these IPs as having submitted the requests:

52.36.20.249
35.166.232.214

Kind Regards,
Jeff | Mailgun Support

Got it working by adding the IP’s from the last post. Might be helpful for other developers.

1 Like

Where did you add those IPs?

1 Like

Hey guys. I’ve made a plugin for Mailgun emails. If you want to test it out, send me the app ID on the DM’s and I’ll release it for free.
Its one of my first plugins so I need more apps running and testing it out before putting it public as I can’t ignore bad reviews :smiley:

*I have not tested for EEA countries yet.