Disable device over API

Is posible disable device via API ?
For example when my customer not pay they subscriptions.

Hi Diego, you can use the TagoIO SDK JS. Follow the documentation here: http://js.sdk.tago.io/en/latest/

const Account    = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
 // generate an account token: my account > profiles > tokens. 
const data = {
    "active":false, // disabling device...
};

const device_id = '576dc932415f403531fd2cf61';
accdevices.edit(device_id, data)
    .then((result) => {
        //You can treat the result here
    })
    .catch((error) => {
        //You can treat errors here
    });

It would be something like this:

const Account    = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;

const device_id = ''5db722ac52d5c3001bbea007"
accdevices.edit(device_id, { active: false });

You can do that directly by https request too:
HTTPS Post: https://api.tago.io/device/5db722ac52d5c3001bbea007
Data: { “active”: false }
Headers:

  • Authorization: account_token