get new token and execute sample REST call
X-Auth-Token header
Username and password required
In order to get token you should send your username and password.
If you do not have any please register here
Getting token is an very easy task. Just send your username and password as part of POST message to https://connect.sensorberg.com/api/token. Please see curl example for more details.
# please note that you must send username and password
# as part of POST form
curl -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "[email protected]&password=your.password" "https://connect.sensorberg.com/api/token"
# for this call you should get response in json format with new token
{"token": "<<token>>"}
// as a result of valid request you will get json response
// with new token that you can use as X-Auth-Token header
// to interact with REST api
{
"token": "token"
}
// when username and / or password in invalid
{
"reason":"Sign In/Password not valid"
}
// when you forgot to send mandatory data
{
"violations":{
"username":"may not be empty",
"password":"may not be empty"
}
}
As a result of this call you should get new token. With it you will be able to execute all actions in our platform like for example get list of beacons
Get list of beacons
To get list of beacons you must send your token as X-Auth-Token header to https://connect.sensorberg.com/api/beacon endpoint. As a result you will get list of beacons.
curl -X GET -H "X-Auth-Token: <<token>>" 'https://connect.sensorberg.com/api/beacons'
Token expiration
A token is valid for 24 hours after the last use of it.
X-Auth-Token header
All endpoints in our cloud platform are protected by authorisation and authentication interceptors that is why it is required to send X-Auth-Token header with your token aways when you want to interact with protected endpoints