Pushbullet is a simple but ingenious app and browser extension that uses push technology to transfer files from a computer to a mobile device and vice versa. Send anything from a grocery list so you don't forget the milk again to a PowerPoint presentation your boss gave you to wow the client. Goodbye, first-world problems; hello, Pushbullet! How to Uninstall Pushbullet Silently Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator Enter one of the following commands. To uninstall Pushbullet for Chrome, run the following command from the command line or from PowerShell: Copy pushbullet-chrome -version 336.0 to Clipboard. Pushbullet shows you WhatsApp messages, texts, phone calls, and more. Follow interesting things. Get notified about things you care about. A new xkcd post, new free games from EA, Google acquisitions, and more. Instantly share links between any of your devices. Never email yourself a link again just to get it somewhere else.
Pushbullet's API enables developers to build on the Pushbullet infrastructure. Our goal is to provide a full API that enables anything to tap into the Pushbullet network.
This is important to us because we believe everything, not just smartphones and computers, should be able to exchange information in real time. Here are some of the things you can build with Pushbullet:
- Have a website and want to offer push notifications? We've built everything you need.
- Want to build a Pushbullet client for a platform we don't officially support yet? Everything you need is here.
- Working on a home automation system? Pushbullet can get everything chatting.
- Working with sensors and want to send messages to another device? Pushbullet is just what you need.
- Manage IT/servers and want to get updates and alerts no matter where you are or what device you're using? Pushbullet makes it easy.
Check out this ProgrammableWeb article for a longer introduction to Pushbullet and this API.
SectionsHTTP API - Send/receive pushes using the Pushbullet server.
Android Extensions - Extensions enable your app to work better with Pushbullet.
iPhone - Interact with the iPhone app from your app or webpage.
Changelog - Recent changes to the API.
If you have any questions, feedback or requests, feel free to contact us at [email protected].
Getting StartedThe HTTP API lets you send/receive pushes and do everything else the official Pushbullet clients can do. To access the HTTP API you'll need an access token so the server knows who you are. You can get one from your Account Settings page.
Once you have that access token, you can use it to access your Pushbullet account over the Pushbullet API:
EXAMPLE REQUEST EXAMPLE RESPONSEAll of our examples use the curl
command line tool already available on most systems. If you don't have it installed you can download it on the curl website.
All POST requests should be over HTTPS and use a JSON body with the Content-Type header set to 'application/json'.
AuthenticationThis API is organized around REST and uses HTTP Basic Auth for authentication.
To authenticate for the API, use your access token as the username in the HTTP Basic Auth header, along with an empty password. Your access token can be found on the Account Settings page. Keep in mind that this key has full access to your account, so don't go posting it all over the internets.
If you are making an app that uses the Pushbullet API on behalf of another user (for instance, to send push notifications as that user), use OAuth to get an access token for that user.
From an App EXAMPLE REQUEST From a BrowserWe allow CORS requests, so you can make a request from any browser:
EXAMPLE XMLHTTPREQUEST ResponsesResponses are always JSON. Keys are either present with a non-null value, or entirely absent from the response. Deleted objects will only have the keys 'iden', 'active', 'created', and 'modified'.
EXAMPLE RESPONSE HTTP Status Code Meanings200 OK
- Everything worked as expected.400 Bad Request
- Usually this results from missing a required parameter.401 Unauthorized
- No valid access token provided.403 Forbidden
- The access token is not valid for that request.404 Not Found
- The requested item doesn't exist.5XX Server Error
- Something went wrong on Pushbullet's side.
Error responses (any non-200 error code) contain information on the kind of error that happened. The response JSON will have an error
property with the following fields:
type
- A machine-readable code to refer to this type of error. Eitherinvalid_request
for client side errors orserver
for server side errors.message
- A (mostly) human-readable error message.param
- (OPTIONAL) Appears sometimes during an invalid_request error to say which parameter in the request caused the error.cat
- Some sort of ASCII cat to offset the pain of receiving an error message.
Objects (such as pushes, devices, and contacts) can be created, modified, listed and deleted.
PaginationWhen listing objects, if you receive a cursor
in the response, it means the results are on multiple pages. To request the next page of results, use this cursor as the parameter cursor
in a further request. Any time you list a collection of objects, they may be multiple pages (objects are always returned with the most recent ones first). You can specify a limit
parameter on any calls that return a list of objects to get a smaller number of objects on each page. The default (maximum) limit is 500, including deleted objects.
All calls to list objects accept a modified_after
property (a timestamp). Any objects modified since that time will be returned, most recently modified first. The modified_after
parameter should be the most recent modified
value from an object returned by the server (don't trust the local machine's timestamp as it usually is not the same value as the server).
When you query with a modified_after
timestamp to sync changed objects to a device, you need to know if an object was deleted so you can remove it locally. Deleted objects will have active
=false
and all properties except for iden
, created
, modified
, and active
will be missing from the returned object. Deleted objects show up when listing objects.
Some objects have an image_url property that can be resized for faster downloading on the client. Here's a list of common domains and how to resize the image to be a 200 pixel square:
googleusercontent.com: add ?sz=<pixels> to the end of the url
graph.facebook.com: add ?width=<pixels>&height=<pixels> to the end of the url
pushbullet.imgix.net: add ?w=<pixels>&h=<pixels>&fit=crop to the end of the url
Objects- /v2/pushes - Push to a device/user or list existing pushes.
- /v2/devices - List or create devices that can be pushed to.
- /v2/contacts - List your Pushbullet contacts.
- /v2/subscriptions - Channels that the user has subscribed to.
- /v2/users/me - Get information about the current user.
- wss://stream.pushbullet.com/websocket - Subscribe to the realtime event stream.
- /v2/ephemerals - Send arbitrary messages to the realtime event stream.
- /v2/upload-request - Upload new files for pushing.
- /oauth2 - Get access to other people's Pushbullet accounts with their permission.
Each push has a target, if you don't specify a target, we will broadcast it to all of the user's devices. Only one target may be specified.
device_iden
- Send the push to a specific device. Appears astarget_device_iden
on the push. You can find this using the /v2/devices call.email
- Send the push to this email address. If that email address is associated with a Pushbullet user, we will send it directly to that user, otherwise we will fallback to sending an email to the email address (this will also happen if a user exists but has no devices registered).channel_tag
- Send the push to all subscribers to your channel that has this tag.client_iden
- Send the push to all users who have granted access to your OAuth client that has this iden.
- Note
type
- Set tonote
title
- The note's title.body
- The note's message.
- Link
type
- Set tolink
title
- The link's title.body
- A message associated with the link.url
- The url to open.
- Address
type
- Set toaddress
name
- The place's name.address
- The place's address or a map search query.
- Checklist
type
- Set tolist
title
- The list's title.items
- The list items, a list of strings e.g. ['one', 'two', 'three'].
- File
type
- Set tofile
file_name
- The name of the file.file_type
- The MIME type of the file.file_url
- The url for the file. See pushing files for how to get afile_url
body
- A message to go with the file.
source_device_iden
- The iden of the device sending the push. This is useful when you need to send a push back to the sending device.
Pushing files is a two-part process: first the file needs to be uploaded, then a push needs to be sent for that file.
To upload a new file, use the upload request endpoint.
Once the file has been uploaded, set the file_name
, file_url
, and file_type
returned in the response to the upload request as the parameters for a new push with type
=file
.
modified_after
- Request pushes modified after this timestamp.
dismissed
- Set to true to mark the push as dismissed. All devices displaying this push should hide it from view.items
- Update the items of a list push. The format should be the same as theitems
property of the push object, e.g. [{'checked': true, 'text': 'Item One'}, {'checked': true, 'text': 'Item Two'}]
push_iden
- The iden of the push to delete.
Any pushes sent to a stream
device will cause tickle messages to appear on the websocket.
device_iden
- The iden of the device to delete.
name
- The name you want associated with the contact.email
- The email address of the contact.
name
- The name you want associated with the contact.
contact_iden
- The iden of the contact to delete.
Subscribe to channels to receive any updates pushed to that channel.
Channels can be created on the website. Each channel has a unique tag to identify it. When you push to a channel, all people subscribed to that channel will receive a push.
To push to a channel, use the channel_tag
parameter on /v2/pushes
iden
- Iden of the subscription.created
- Created timestamp.modified
- Modified timestamp.active
- True if the subscription has not been deleted.channel
- Properties of the channel that is being subscribed to.iden
- Iden of the channel.tag
- Unique tag for the channel.name
- Name of the channel.description
- Description of the channel.website_url
- Link to a website for the channel.image_url
- Image to use for the channel.
channel_tag
- The tag of the channel you wish to subscribe to.
iden
- The iden of the subscription.
tag
- The tag of the channel.
preferences
- The user's preferences (a json object, overwrites existing object).
All messages are JSON objects with a type
key.
type=nop
- Sent every 30 seconds confirming the connection is active.type=tickle
- Tells you something has changed on the server. Thesubtype
property tells you what has changed.subtype=push
- A change to the /v2/pushes resources.subtype=device
- A change to the /v2/devices resources.
type=push
- A new push. The push data is available in an object from thepush
key. This is only used for pushes that do not appear under /v2/pushes (such as mirrored notifications).
A message with type=push
will contain a data object mapped to by the key push
. This object is documented here based on its internal type
.
type=mirror
- This push is a notification mirrored from an Android device.type=dismissal
- This push is a dismissal message from an Android device.
When you receive a tickle message, it means that a resource of the type subtype
has changed. This is your cue to update that resource. Here's an example for the pushes
type:
On receiving this message:
Request the pushes that have changed since the last time we received them:
Then merge these updates into your local copy of the push history.
Note: It's best to use the most recently modified local push's modified
timestamp when making requests for updates. This will keep the responses small and fast. Additionally, don't trust the local machine's current timestamp because it is inevitably different from the server's timestamp.
file_name
- The name of the file you want to upload.file_type
- The MIME type of the file.
Copy of all the parameters from the data
object in the response to the upload request. In addition to that, the file should be uploaded as the parameter file
. This request is more complicated than most of the other API requests and requires multipart/form-data
encoding.
After the request completes, the file will be available at file_url
from the upload request response.
OAuth lets you access a user's Pushbullet account or have them authenticate with their Pushbullet account using a browser.
OAuth is a standard authentication procedure used by most websites, here's how it works:
- You, the app developer, register your app (called an 'OAuth client') with Pushbullet
- Using a url you generate in your app (you can see an example one on the Create Client page) you send the user to the Pushbullet site. One of the parameters of the url is a redirect url that the user will be sent to when they are done authorizing your app.
- The user authorizes your application by clicking the 'Allow' button.
- The user is redirected to the redirect url you provided earlier, which is generally your site or your app.
Here's roughly how this looks with pictures:
Getting StartedTo get started, create a client (register your application) on the Create Client page. For the examples on this page, the client looks like this:
EXAMPLE CLIENT Getting an Access TokenOnce you've created a client, you can send a user to https://www.pushbullet.com/authorize with the following parameters:
client_id
-client_id
from registering your clientredirect_uri
- The url you want to redirect the user to after authorization is complete. The path portion must match what was provided for the client, the query string may be set dynamically.response_type
- Either 'code' (if you've got a server) or 'token' (if your app is entirely on the client)
NOTE: There's an example url ('oauth test url') on the Create Client page for your app.
When the user is sent to this page, they are able to authorize or deny your application. If they choose deny, they get redirected to the redirect_uri with the parameter 'error=access_denied'.
If they chose authorize, there are two possible next steps, depending on the value of response_type:
For Client-Side Apps: response_type=tokenThe user is redirected to the redirect_uri with a url fragment of 'access_token=<access_token>'. If you have a client side app running an embedded web browser, you can configure your redirect_uri to be 'https://www.pushbullet.com/login-success' and then use this redirect_uri in the authorize call.
EXAMPLE URL EXAMPLE REDIRECT For Apps with Servers: response_type=codeIf you have a server you can use this response_type, it's potentially more secure than the client-side one, since the client never sees the actual access token. In this mode the user is redirected to the redirect_uri with a parameter 'code=<code>'.
EXAMPLE URL EXAMPLE REDIRECTYour server then peforms a request to https://api.pushbullet.com/oauth2/token with the following parameters:
grant_type
- Set to 'authorization_code'client_id
-client_id
from registering your clientclient_secret
-client_secret
from registering your clientcode
-code
from the redirect
You can add extra query params to the end of redirect_uri if you need to store extra state for the request. For instance, if you have your client's redirect_uri
set to http://www.catpusher.com/auth_complete
, then when you build the url to send the user to Pushbullet, you could specify redirect_uri=http://www.catpusher.com/auth_complete?state=zhk2KJ3SAAS3q1
. When the user finishes authorizing your app, they would end up at http://www.catpusher.com/auth_complete?state=zhk2KJ3SAAS3q1&code=RUe7IZgC6384GrI1
.
Now that you have an access token, you can access Pushbullet as that user. Just include the access_token
with your requests as the username in HTTP Basic Auth or set the Authorization
header to Bearer <access_token>
. Make sure to keep the access_token
in a safe place, it allows access to your users accounts!
The access_token
does not have a set expiration time, but may be expired at some point in the future. If you delete your client, all existing tokens are invalidated.
Send arbitrary JSON messages, called 'ephemerals', to all devices on your account. Ephemerals are stored for a short period of time (if at all) and are sent directly to android and stream devices (iOS not supported yet). Because they are sent directly, there is no 'tickle' message like when creating or updating pushes or other objects, the JSON message appears directly in the stream.
Ephemerals are used by the Pushbullet apps for notification mirroring and universal copy/paste.
Unlike some of the other HTTP endpoints, POST parameters are not supported for ephemerals due to their JSON structure.
Send an ephemeral Parameterstype
- Must be set topush
which is the only type of ephemeral currently.push
- An arbitrary JSON object.
Ephemerals respond with an empty JSON object unless there is an error.
Mirrored NotificationsMirrored notifications are notifications sent from android devices (currently the only source of mirrored notifications) to other devices. To test these out you can go into the android app's settings screen and hit the button 'Send a test notification' while listening to the stream.
Notification Ephemeraltype
-push
for mirrored notifications.push
- information about the notificationtype
-mirror
for mirrored notifications.icon
- Base64-encoded JPEG image to use as the icon of the push.title
- The title of the notification.body
- The body of the notification.source_user_iden
- The user iden of the user sending this message.source_device_iden
- The iden of the device sending this message.application_name
- The name of the application that created the notification.dismissable
- True if the notification can be dismissed.package_name
- The package that made the notification, used when updating/dismissing an existing notification.notification_id
- The id of the notification, used when updating/dismissing an existing notification.notification_tag
- The tag of the notification, used when updating/dismissing an existing notification.has_root
- The phone is rooted.client_version
- The client version of the app sending this message.
type
-push
for notification dismissals.push
- information about the dismissal.type
-dismissal
for notification dismissals.package_name
- Set to thepackage_name
field from the mirrored notification.notification_id
- Set to thenotification_id
field from the mirrored notification.notification_tag
- Set to thenotification_tag
field from the mirrored notification.source_user_iden
- Set to thesource_user_iden
field from the mirrored notification.
The Pushbullet apps (currently the Android and Windows apps) can monitor the clipboard and send out a message each time the user copies a new text selection, sending it to all the user's devices which can copy it to the clipboard or otherwise make it available to the user.
Copy a String to the Clipboard Propertiestype
-push
for clipboard messages.push
- information about the clipboard message.type
-clip
for clipboard messages.body
- The text to copy to the clipboard.source_user_iden
- The iden of the user sending this message.source_device_iden
- The iden of the device sending this message.
Extensions enable your app to work better with Pushbullet.
Extension For Messaging Apps - Add quick-reply support from Pushbullet notifications on PC.
Pushbullet's messaging extension enables any messaging app on Android to offer quick-reply functionality from PC via desktop notifications shown by Pushbullet's notification mirroring service.
By integrating with Pushbullet, you make your app's desktop notifications actionable: when Pushbullet shows a notification from your app on PC, clicking on it will open a window enabling users to quickly reply to the message. This gives your app an incredibly convenient cross-platform experience.
Getting Started Is EasyTo get the Pushbullet extension set up your app:
Add compile 'com.pushbullet:android-extensions:[email protected]' or the API jar to your Android project.
Create a new service that extends the MessagingExtension class.
Add the corresponding <service> tag to your AndroidManifest.xml file and add the required <intent-filter> and <meta-data> element.
Once you have your extension set up, you'll be able to mirror messages to PC and receive replies composed on PC.
Implementing Your ExtensionThe full guide is available here.
Sample ProjectA working example is available here on Github.
NotesMessages are only sent to PC if the user has notification mirroring enabled, protecting their privacy.
Everything is done over secure (https) connections ensuring user privacy.
The use of a conversation identifier means we don't need to know phone numbers for this to work.
Once you've got compile 'com.pushbullet:android-extensions:[email protected]' or the API jar included in your project, the first thing to do is create a new service that extends the MessagingExtension class.
After creating this new service, add the corresponding <service> tag to your AndroidManifest.xml file and add the required <intent-filter> and <meta-data> element like so:
Extending MessagingExtensionWhen you extend MessagingExtension, there are two methods you'll need to implement:
onMessageReceived(String conversationIden, String message)
onConversationDismissed(String conversationIden)
onMessageReceivedThis method will be called when a new reply has been composed on PC and is being forwarded to your app for delivery.
The parameter conversationIden is the value you provided to Pushbullet identifying the contact/group/thread. In this case it tells you where the message should be sent. For an SMS app this may be the thread ID.
The parameter message is the reply the user entered.
onConversationDismissedThis method is called when the notification for a conversation has been dismissed on the PC. You should use this to update or remove the notification shown on the user's phone by your app.
Implementing this correctly means updating your notification representing multiple active conversations (if your app groups conversations into one notification) without necessarily dismissing it.
The parameter conversationIden is described here.
Mirroring Conversations To PCOnce you've implemented (or stubbed out) your service extending MessagingExtension, you'll need to tell Pushbullet to mirror incoming messages to PC.
To do this, all you need to do is call the following static method on MessagingExtension when new messages are received:
mirrorMessage(Context context, String conversationIden, String sender, String message, Bitmap image, String notificationTag, int notificationId)
A context is used to confirm Pushbullet is installed and then to call startService, sending this data to Pushbullet for mirroring.
Use conversationIden to identify the contact/group/thread this message is associated with. This value will be returned to you with any reply messages.
The sender should be the name of the contact this message is from.
The message should be the text of the message.
Include the contact's picture as image.
The notificationTag and notificationId should be the tag and id of the notification provided to Android's NotificationManager for the notification for this conversation. Multiple conversations can have the same tag and id if you group conversations into one notification. See this and this. (Use null for notificationTag if you don't specify one when calling notify.)
Note: providing the correct notificationTag and notificationId is important to your extension functioning properly. If these value are incorrect, the notifications will not be synced correctly.
Pushbullet URL HandlerThe iPhone app has a url handler, pushbullet://
that can be used to compose pushes like so:
compose
is the only option right now, but a few push types can be constructed (make sure to urlencode any parameters):
Only type
=note
type
=link
and type
=address
are supported for now (and their parameters are the same as the /v2/pushes HTTP endpoint), other types and actions will be added in the future.
If you use a UIDocumentInteractionController to preview a file, when the user selects 'Open In...' for most file types, Pushbullet should show up in the list of applications.
If the user selects the Pushbullet app, the app should open with a new compose window for a type
=file
push with the provided file attached.
Let us know what you think at [email protected]
February 12, 2015- Added information about resizing images
- Changed docs to single-page layout
- Added subscriptions
- Added
channel_iden
andclient_iden
to the push object - Added description of deleted objects
- Added
source_device_iden
to the push object - Added documentation for using list pushes to /v2/pushes and changed curl examples to use JSON
- Removed
android_version
andandroid_sdk_version
from device object - Made
error
objects more consistent
- Added
limit
parameter to paginated results
- Removed
google_userinfo
andgoogle_id
from user object - Added
image_url
andname
to user object - Removed
android_install_identifier
andandroid_token
from device object - Added Update
preferences
for user
- Added Update
dismissed
field for pushes - Added Create a contact