Can you paste the full command used to create the webhook? I will give it a try.
Webhooks might be down so ping @Dave
Can you paste the full command used to create the webhook? I will give it a try.
Webhooks might be down so ping @Dave
Yes:
particle webhook GET get_weather http://w1.weather.gov/xml/current_obs/KMSP.xml
Thanks!!
Hey @Dave, I need some help.
Heya @itayd100,
Are you still having an issue? It sounds like youāre publishing as expected, but maybe the hook isnāt setup quite right? Do you have a core/photon claimed to your account, and youāre using the example from the docs? Can you create the hook and maybe message me when itās setup and Iāll check things on our end?
Thanks,
David
Hey @Dave,
I tried to hook again now and finally its working!
I did the same step that @kennethlimcp and @peekay123 told me to do yesterday: delete the list and hook againā¦
Now, I understand what I should get in the dashboard. Maybe itās good to add it to the troubleshooting in the example.
I am going to try and hook more commands, hope everything will be good.
@peekay123 @kennethlimcp @Dave, Thanks a lot for the help!
Hey @peekay123, I need some more helpā¦
Iām trying to make a json file, but the CLI says: āPlease specify an event nameā
{
"eventName": "breez1",
"url": "http://api-beta.breezometer.com/baqi/",
"requestType": "GET",
"headers": null,
"query": {
"lat": "my-lat-number",
"lon": "my-lon-number",
"key": "my-key",
},
"mydevices": true
}
use event
instead of eventName
due to a CLI bug for now.
Opps, eventName
is correct.
You have an extra ,
.
Try this:
{
"eventName": "breez1",
"url": "http://api-beta.breezometer.com/baqi",
"requestType": "GET",
"headers": null,
"query": {
"lat": "my-lat-number",
"lon": "my-lon-number",
"key": "my-key"
},
"mydevices": true
}
Hey @kennethlimcp,
Thanks for the answer, it's working, but he didn't get the "requestType". In the CLI it says: "undefined"
I tried to change to POST but still it doesn't work.
Not sureā¦ Are you using the latest version? Works for me:
KENMBP:Desktop kennethlimcp$ particle webhook create test.json
Using settings from the file test.json
Sending webhook request { uri: 'https://api.particle.io/v1/webhooks',
method: 'POST',
json: true,
form:
{ eventName: 'breez1',
url: 'http://api-beta.breezometer.com/baqi',
requestType: undefined,
headers: null,
query: { lat: 'my-lat-number', lon: 'my-lon-number', key: 'my-key' },
mydevices: true,
event: 'breez1',
deviceid: undefined,
access_token: 'xxxxxx' } }
Successfully created webhook!
@kennethlimcp, the hook is working, but I'm getting this message back on the dashboard:
"405 Method Not Allowed\n\nThe method POST is not allowed for this resource. \n\n "
I need to make it a GET request.
@peekay123 it sounds like the issue here: https://github.com/spark/particle-cli/commit/eb3ca2d4f030468cf8e83a129ef823956a22f6cb
Issue is fixed but Particle-cli version has not been bumped.
@itayd100, unfortunately the workaround is not straightforward and we will have to wait for a release for Particle-cli for you to use the .json
settings properly.
So for now i would call it a bug.
@itayd100, Particle-cli has been updated. Can you perform a npm update -g particle-cli
and bring it up to the latest version?
The .json
will now be:
{
"event": "breez1",
"url": "http://api-beta.breezometer.com/baqi",
"requestType": "GET",
"headers": null,
"query": {
"lat": "my-lat-number",
"lon": "my-lon-number",
"key": "my-key"
},
"mydevices": true
}
Hey @kennethlimcp,
The GET requestType is working!
Next mission is to get just the headers that I need.
Thank you and all the team!
Hey @kennethlimcp,
I want to ask every time on different location, can I send the query parameters from the Core with publish command?
Hmmā¦ What do you mean? Donāt think i understood what you are asking about.
@kennethlimcp, I want to send a GET request with the webhook, but every time different parameters.
For example:
One time:
http://api-beta.breezometer.com/baqi/lat= {LAT1} &lon= {LON1 } &key=TOKEN
Sec time:
http://api-beta.breezometer.com/baqi/lat= {LAT2} &lon= {LON2 } &key=TOKEN
Can I do that with the webhook?