Welcome to Question of the Day! These posts help you get comfortable integrating different technologies with Pinoccio, and easily find what you need in our documentation.
Suppose you're building an iOS app with buttons to control your Scouts. Or, perhaps you want a web page to display live sensor data (like on our homepage). You'll be communicating with our REST API, using tokens to identify yourself to the system—so your Scouts stay safe, even while they're available to the world.
Jake has just deployed a convenient new way to manage tokens: the HQ Settings page. You can create, track, and revoke keys here with the click of a mouse button!
If you rock it old school, you can use the command line, too. Start off by creating (logging in with) a new token:
curl -X POST -v --data 'email=YOUR-PINOCCIO-EMAIL&password=YOUR-PINOCCIO-PASSWORD' https://api.pinocc.io/v1/login
Now, you can instantly control any Scout that has access to the Internet! For example, say I want to trigger the torch LED on my Scout, Bridget. First, I'll find Bridget's troop and scout ID numbers:
Since this is my ninth created troop, and Bridget was the 11th Scout added, her numbers are 9 and 11. I simply substitute those numbers, and my newly-created token, into this URL:
...And the LED will come on. Here's an example project that uses this workflow, embedding the control system into a simple web page with a button.
If I want to read sensor data instead, I'll make the token read-only so I can use it on a website without enabling other people to control my Scout:
curl -X POST https://api.pinocc.io/v1/account/token?token=TOKEN
And finally, to destroy the token:
curl -X POST https://api.pinocc.io/v1/logout?token=TOKEN
That's it! You can now manage your tokens like a pro.
This information is part of our REST API docs.