Hi there,
I wanted to show you guys what I am using to control my Spark Core from my android phone, temporarily until I get around to build my own.
The free app is called “REST Client for Android”, and you can find it here:
https://play.google.com/store/apps/details?id=com.sourcestream.android.restclient
(I am not the author so a million thanks to him!)
In order to send an HTTP POST request, you open the app and then configure:
- HTTP Method: POST -
- URL: https://api.spark.io/v1/devices/01234567890123456789/functionX
- add an HTTP Header by tapping on the plus blue button and select Authorization, then enter:
Bearer 99988887777666655554444333322221111
What you need to know:
- in the URL 01234567890123456789 is your DEVICE_ID (See http://docs.spark.io/api/)
- in the URL functionX should be changed to the name of your exposed function
- in the Authorization Header 99988887777666655554444333322221111 is your access token (See http://docs.spark.io/api/)
Once configured, you can hit the Send button to send your request. If you got everything right, the answer will not contain any errors!
Here is a sample screenshot of it:
For future uses, save your request by hitting the save button
With few changes, you can also get the values of your exposed variables on your Spark Core.
Happy hacking!
Gustavo.