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?

1 Like

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:

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:

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?