Building your URL one parameter at a time
Click on the "settings" link under any bucket name in the bucket shelf. This will bring up the screen above. Copy the text in the API Endpoint section and paste it in your favorite text editor. We will use this to build a URL that we can use to send data into our bucket.
In my example bucket, the text that I copied looks like:
https://groker.initialstate.com/api/events?accessKey=XrBbXmBI4CuyKq5DdZHkCJ2No6RCaM92&bucketKey=EW6YSRRDLRER
Your URL will have your accessKey and bucketKey. We need to add a stream name and value to the URL parameters to complete the URL. Add "&MyStream=off" to your URL (don't copy mine):
https://groker.initialstate.com/api/events?accessKey=XrBbXmBI4CuyKq5DdZHkCJ2No6RCaM92&bucketKey=EW6YSRRDLRER&MyStream=off
Paste your complete URL to the address bar of your browser and hit enter (or use the 'curl' command at a command prompt) to send the event, "off", to the stream, "MyStream", in your new bucket.
If you look at your bucket in Tiles now (you may have to refresh if you get impatient), a new Tile named MyStream should have appeared with the value of "off" displayed. You can send data to this stream again using the same URL but changing the value of MyStream:
https://groker.initialstate.com/api/events?accessKey=XrBbXmBI4CuyKq5DdZHkCJ2No6RCaM92&bucketKey=EW6YSRRDLRER&MyStream=on
You could have used the curl command to accomplish this same thing (make sure you wrap quotes around the URL):
curl 'https://groker.initialstate.com/api/events?accessKey=XrBbXmBI4CuyKq5DdZHkCJ2No6RCaM92&bucketKey=EW6YSRRDLRER&MyStream=on'
Create a new data stream and send only numerical values into it.
Create a new data stream and send emoji tokens into it (e.g. &MyMessage=:smile:).
Create a new data stream and send GPS coordinates into it (e.g. &MyLocation=28.4186579,-81.5816253)
Comments
0 comments
Article is closed for comments.