Maker API with MailParser

I'm trying to send data to my HE Maker API endpoint. When I use a browser, I can GET any command I try, either with local or cloud access. Everything works great.

However, when I try to set it up as a webhook endpoint (in this case MailParser), I get a 403 error every time.

Is MailParser somehow blocked from accessing the endpoint? Is there something I'm missing?

Hmmm... That is an odd situation.....

Bet I can think to mention is to make sure you have enabled the "Allow Access via local addresses". Beyond that... I am not sure....

Can you share more details? I cannot think of a reason you'd get the 403.

More details:

I have Maker API configured as follows:
Allow Access via Remote / Cloud: ON
Allow Access via Local IP Address: ON
Allow Endpoint to Control These Devices: All devices

If I use some of the sample cloud URLs to access the hub, they work flawlessly from a browser or another tool such as Postman. I send a GET request (to https://cloud.hubitat.com/api/...) and get back JSON. No issues.

However, if I configure MailParser to do the same GET request, I get a 403 error:

ERROR RETURNED:
Oh ... something went wrong ...
The server responded with the HTTP response code 403 but we were expecting a response code 20X. Please check if the target URL is correct and the remote server is correctly set up.

HTTP GET request to URL (I have redacted my access_token.)

https://cloud.hubitat.com/api/311e2ee3-ea96-4666-b458-e8a498a1a380/apps/845/devices/620/commands?access_token=

Body payload

id=7db4771f7dc7a623a13da6b156a9fbb9&received_at=2022-09-27+22%3A40%3A18&received_at_timestamp=1664318418&received_at_iso8601=2022-09-27T22%3A40%3A18%2B00%3A00&processed_at=2022-09-27+22%3A40%3A20&processed_at_timestamp=1664318420&processed_at_iso8601=2022-09-27T22%3A40%3A20%2B00%3A00&firstname=Bentley&lastname=Clough&phone=5665566

Response time:

0.017s

Response code

403

Response body

ERROR: The request could not be satisfied

403 ERROR

The request could not be satisfied.


Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.

 Generated by cloudfront (CloudFront) Request ID: XC_3CI6VOK8uZ8FvhTSBfhfO7Y2kzJuoB7aaMacAO19GwrkLjymHfA== 

CLOSE

Here is my MailParser configuration. In this instance, I'm just calling getCodes() from the API of my door lock device.

If I run this GET request through my browser, it succeeds. If I run it from Mail Parser, it fails.

I figured it out.

When setting up a MailParser webhook to Maker API, MailParser wants to send along any fields and metadata. Under "Data Structure", you need to select "Custom - provide your own template", then just leave the template blank.

Problem solved!

2 Likes

Thanks for posting what you found instead of simply saying "I fixed it" and disappearing. :smiley: Very helpful for other users.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.