Search code examples
pushbullet

Receive notifications through PushBullet API


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?


Solution

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