pushbullet - How to query the pushes for a device? -
i want use pushbullet
send pushes phone application (which display it). application service written in python.
the basic reception of realtime stream works:
import websocket ws = websocket.create_connection("wss://stream.pushbullet.com/websocket/mykey") while true: result = ws.recv() print"received '%s'" % result
when pushing "all devices", expected output:
received '{"type": "nop"}' received '{"type": "nop"}' received '{"type": "tickle", "subtype": "push"}' received '{"type": "nop"}' received '{"type": "tickle", "subtype": "push"}'
what receive not contain data, type 'tickle
', , the documentation says
when receive tickle message, means resource of type subtype has changed.
and query details on server. call mentioned there (get https://api.pushbullet.com/v2/pushes?modified_after=1399008037.849
) not authenticated, how make call?
alternatively, wanted create "device" application , send pushes directly. cannot find place in docs process of impersonating device described?
i gave try get
authorization
header , worked:
# ts timestamp 1 wants check on ts = 0 headers = {'authorization': 'bearer mykey'} r = requests.get( 'https://api.pushbullet.com/v2/pushes?modified_after={ts}'.format(ts=ts), headers=headers )
since target_device_iden
sent push details when push directed specific device, guess there no "impersonation" (per second part of question): every device gets whole feed , selects events directed (or mirrored ones)
Comments
Post a Comment