Here’s an overview of my setup:
I have a particle board that is live and running. It’s publishing as expected using the particle.publish method. Looking on the dashboard I’m getting appropriate data.
I’ve added an integration to POST data to my web endpoint.
I have a web endpoint where I can watch logs and see that the integration is indeed hitting the correct rest endpoint.
When I look through the logs for the integration, it tells me it’s failing because it’s using a GET method. I can confirm this on the web app side too. I’ve double and triple checked that I’m set up for a POST request.
I have an almost identical integration for a different board that is setup the same except for enforcing SSL. I doubt this matters, but mentioning in case I missed something in the docs.
What is the cause of this and how do I make it use the POST option that I have selected?
To be sure the method is set in the integration:
Open up the integration, then click Edit, then Custom Template and copy and paste the JSON. Replace any sensitive parts of the URL or authentication.
See item 2 above. The request type is set up for POST. The request format is set up for JSON, but it’s contents don’t matter yet as my web app rejects any GET requests.
Right, but if it’s submitting as GET instead of POST, I was interested if it’s a console UI bug, in which case the underlying JSON might be different.
Since your integration logs show the wrong method it’s probably not this, but also make sure you don’t have a second webhook with the same event name that is GET.
Does your server have an automatic redirect from http to https set up? That’s another reason a POST can cause a GET to be done in response to the 301 if you make a http request.
Another good test is to set up a request bin and change your webhook URL to point at the bin, which will log everything being sent by Particle integration server.
To answer your questions and comments:
- There are no other webhooks set up that use this eventname
- There are no webhooks (or any other integrations) that use GET
- My web app doesn’t currently support https. If you try on port 443, it will time out. There is no redirect on http.
I’ve tested the payload using curl and I’m able to POST from my home machine.
The error logs on the integration page show that it’s trying to use GET where POST is selected in the settings. I have other POST integrations that ran ok in the past and I haven’t changed any settings. (Those particle boards are not currently live, so don’t know if they’d fail today, but I’ve used them successfully in the past).
I think I’ll need to reach out to support. There’s a bug somewhere in the system separate from user error on my part. For some reason it’s defaulting to GET methods, where it should be POSTing.