Pushbullet syntax structure

201 views Asked by At

I've recently discovered pushbullet and use it in Node-Red on my raspperry Pi to send temperature details from an arduino on demand to my phone.

I'm using the pushbullet app but I would like to create my own android app with app inventor but just DO NOT GET the structure of how I format the POST command with the web component. I've looked at hundreds of examples but I just don't get it they talk about cURL etc and JSON.

Can someone please just type a push command so that if it was copied into my browser address bar with my API key it would push a note, I can then use this structure to create my app, I'm not normally a slow person but I just cannot get my head around the structure of these POST/GET API commands, silly I know but there it is!!

Hope someone can help, thanks, Phil

1

There are 1 answers

0
Chris Pushbullet On

Sorry about that! The next version of the API will hopefully be more simple. You cannot do this in a browser's address bar (browsers do not allow you to do a POST request from the address bar). I think what you want is an HttpRequest node in Node-Red. I tried reading the docs for Node-Red but couldn't find many details about how to do that. There is a stackoverflow post here that might help: HTTP POST in node-red js

You need to do an HTTP POST request with 'Authorization' and 'Content-Type' headers set and a JSON body.

Here's the example curl command:

curl --header 'Authorization: Bearer <your_access_token_here>' -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "Note Title", "body": "Note Body"}'

The relevant information here:

url: https://api.pushbullet.com/v2/pushes
method: POST
headers:
  Authorization: Bearer <your_access_token_here>
  Content-Type: application/json
body: {"type": "note", "title": "Note Title", "body": "Note Body"}