Beebotte associates a Token
to every created channel. This token can be used to authenticate read and write operations on that channel.
Channel Token authentication uses either:
HTTP Authorization
headertoken
query parametertoken_
. We recommend switching to this token format. You can regenerate new tokens for your channels as described here.Authorization Header
example:POST /v1/data/write/demo/resource1 HTTP/1.1 Content-Type: application/json Date: Mon, 07 Oct 2013 14:04:50 GMT host: beebotte.com X-Auth-Token: 1234567890 {"data":"37","ts":1400761008646}
token query parameter
example:POST /v1/data/write/demo/resource1?token=1234567890 HTTP/1.1 Content-Type: application/json Date: Mon, 07 Oct 2013 14:04:50 GMT host: beebotte.com {"data":"37","ts":1400761008646}
//Include the Beebotte SDK for nodejs var bbt = require('beebotte'); var bclient = new bbt.Connector({token: 'CHANNEL_TOKEN'});
# Include the Beebotte SDK for Python from beebotte import * bclient = BBT(token = "CHANNEL_TOKEN")
//Include the Beebotte SDK for nodejs var bbt = require('beebotte'); bclient = bbt.Stream({transport: { type: 'socketio', token: 'CHANNEL_TOKEN' })
You can use Beebotte Nodejs SDK to connect to Beebotte using MQTT as follows:
//Include the Beebotte SDK for nodejs var bbt = require('beebotte'); bclient = bbt.Stream({transport: { type: 'mqtt', token: 'CHANNEL_TOKEN' })
If you are using an MQTT client library, provide CHANNEL_TOKEN
as username and leave the password blank.
If the Channel token was generated before June 1 2018, you need to prefix it with token:
like token:channel_token_content
.