2

At the moment I'm playing a bit with the PushBullet API. I can send notifications, create new devices and so on but the only thing I can't is receive messages. I have created a web application and have created a new device over the pushbullet API but now if I send a notification to this device my web application is not informed about that. Of course I also need a handler method for this. Do you have any ideas how I can implement this in my application?

Cilenco
  • 6,951
  • 17
  • 72
  • 152

1 Answers1

2

You can listen on the websocket for a tickle notification (this means there are new pushes available at https://api.pushbullet.com/v2/pushes) https://docs.pushbullet.com/#stream

So whenever you get a tickle:

{"type": "tickle", "subtype": "push"}

you can do a request to:

https://api.pushbullet.com/v2/pushes?limit=1 

to get the most recent push.

Chris Pushbullet
  • 1,039
  • 9
  • 10
  • Thank you for this works great! Is it right that I get **all** notifications from my account and have to decide (i.e. with the iden) if the notification was for my application? – Cilenco Apr 14 '15 at 17:57
  • 1
    Yes, there are very limited filtering options for /v2/pushes. Just like limit and active. – Chris Pushbullet Apr 15 '15 at 05:42