BreezoSpark - Air Pollution Station

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!

1 Like

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.

Hey @kennethlimcp,

Still doesn’t work.

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
}

2 Likes

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.

@itayd100, can you run ā€œparticle --versionā€ to see what version of CLI you have?

@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.

1 Like

@kennethlimcp, @peekay123: 1.5.11

@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.

1 Like

@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
}

2 Likes

Hey @kennethlimcp,

The GET requestType is working!
Next mission is to get just the headers that I need.
Thank you and all the team!

2 Likes

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?