I’m pretty new to using webhooks, and I’m trying to send a JSON query to the Google Geolocation API. What I’ve done so far is make some code that scans for wifi and formats the the data as specified via the API. If i do a JSON request from my command line, it comes out fine. Here’s the JSON file I send:
{
"considerIp": "false",
"wifiAccessPoints": [
{"macAddress": "00:11:22:33:44:55",
"signalStrength": -70,"channel": 1},
{"macAddress": "00:AA:BB:CC:DD:FF",
"signalStrength": -75,"channel": 11}
]}
Using the call from the terminal:
$ curl -d @sample.json -H "Content-Type: application/json" -i "https://www.googleapis.com/geolocation/v1/geolocate?key=APIKEY"
This works great. Now I’d like my photon to do the call, so I’m trying to set up a web-hook. Inevitably, no matter what I’ve tried I get an error. Here are a couple of things i’ve tried, and their associated errors:
{"error":{"errors":[{"domain":"geolocation","reason":"notFound","message":"Not Found"}],"code":404,"message":"Not Found"}}
This API does not support parsing form-encoded input.
Or (the worst), I get a successful call that returns a Lat/Long in DC… I think because the particle server is sending google a blank package, and so Google is trying to use the IP address of the particle server to guess the location:
hook-response/geolocation/0, data: {
"location": {
"lat": 39.043756699999996,
"lng": -77.4874416
},
"accuracy": 3439.0
}
I feel like i’m completely stuck here. Any ideas on how to troubleshoot? I’m fairly certain the issue is with how i’m setting up the webhook.
P.s. WHY?! Why can’t you edit a webhook once you create it!?