Account¶
In order to modify information in the account, dashboard, bucket, device and any other settings, it is necessary to use the device functions.
To setup an account object, you need a token that you need to get in our admin website. Make sure to use tokens with the correct write/read previlegies for the current function that you want to use. For example, a token with only read previlegies can’t create, modify or delete anything from an account.
.info¶
Get all account information
const Account = require('tago/account');
const myacc = new Account('0e479db0-tag0-11e6-8888-790d555b633a');
myacc.info()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.tokenList¶
Get all tokens from the account
const Account = require('tago/account');
const myacc = new Account('0e479db0-tag0-11e6-8888-790d555b633a').profiles;
const profile_id = '5d71b897631b9f001b2b66a1';
myacc.tokenList(profile_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.tokenCreate¶
Generate and retrieve a new token for the account
const Account = require('tago/account');
const myacc = new Account('0e479db0-tag0-11e6-8888-790d555b633a').profiles;
const profile_id = '5d71b897631b9f001b2b66a1';
myacc.tokenCreate(profile_id, {"name":"My First Token", "expire_time": New Date()})
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.tokenDelete¶
Delete current token of the account
const Account = require('tago/account');
const myacc = new Account('0e479db0-tag0-11e6-8888-790d555b633a').profiles;
const profile_id = '5d71b897631b9f001b2b66a1'
myacc.tokenDelete(profile_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Devices¶
Across the account function, it is possible to manage all your devices. Make sure that you use an account token with “write” permission when using functions to create, edit and delete. The Device method is completly different from the class Device, since this one can only manage devices, and can’t do anything with data related to the device.
.list¶
Retrieve a list with all devices from account
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
accdevices.list()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.create¶
Generate and retrieve a new device for the account
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
var data = {
"name":"My first device",
"description":"Creating my first device",
"active":true,
"visible":true,
"tags": [
{"key": "client", "value": "John"}
]
"configuration_params": [
{"sent": false, "key": "check_rate", "value": 600}
{"sent": false, "key": "measure_time", "value": 0}
]
};
accdevices.create(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.edit¶
Modify any property of the device.
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
var data = {
"name":"New name for my device",
"description":"In this way I can change the description too",
"active":false,
"visible":true,
"tags": [
{"key": "client", "value": "Mark"}
]
};
accdevices.edit('576dc932415f403531fd2cf6', data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.info¶
Get information about the device
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
accdevices.info('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.delete¶
Delete device for the account
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
accdevices.delete('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.tokenList¶
Retrieve a list of all tokens of the device
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
accdevices.tokenList('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.tokenCreate¶
Generate and retrieve a new token for the device
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
accdevices.tokenCreate({"name":"My First Token", "expire_time": "never", "permission":"full"})
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.tokenDelete¶
Delete an token of the Device
const Account = require('tago/account');
const accdevices = new Account('0e479db0-tag0-11e6-8888-790d555b633a').devices;
accdevices.tokenDelete('298d17f0-7061-11e6-ab66-b174d8afb89d')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Buckets¶
Across the account function, it is possible to manage all your buckets. Be sure to use an account token with “write” permissions when using functions like create, edit and delete.
.list¶
Retrieve a list with all buckets from account
const Account = require('tago/account');
const accbuckets = new Account('0e479db0-tag0-11e6-8888-790d555b633a').buckets;
accbuckets.list()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.create¶
Generate and retrieve a new bucket for the account
const Account = require('tago/account');
const accbuckets = new Account('0e479db0-tag0-11e6-8888-790d555b633a').buckets;
var data = {
"name":"My first bucket",
"description":"Creating my first bucket",
"visible":true,
"tags": [
{"key": "client", "value": "Francisco"}
]
};
accbuckets.create(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.edit¶
Modify any property of the bucket.
const Account = require('tago/account');
const accbuckets = new Account('0e479db0-tag0-11e6-8888-790d555b633a').buckets;
var data = {
"name":"New name for my bucket",
"description":"This way I can change the description too",
"visible":true,
"tags": [
{"key": "client", "value": "Leonardo"}
]
};
accbuckets.edit('576dc932415f403531fd2cf6', data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.info¶
Get information about the bucket
const Account = require('tago/account');
const accbuckets = new Account('0e479db0-tag0-11e6-8888-790d555b633a').buckets;
accbuckets.info('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.delete¶
Delete bucket for the account
const Account = require('tago/account');
const accbuckets = new Account('0e479db0-tag0-11e6-8888-790d555b633a').buckets;
accbuckets.delete('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Actions¶
Across the account function, it is possible to manage all your actions. Be sure to use an account token with “write” permissions when using functions like create, edit and delete.
.list¶
Retrieve a list with all actions from account
const Account = require('tago/account');
const accactions = new Account('0e479db0-tag0-11e6-8888-790d555b633a').actions;
accactions.list()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.create¶
Generate and retrieve a new action for the account
const Account = require('tago/account');
const accactions = new Account('0e479db0-tag0-11e6-8888-790d555b633a').actions;
var data = {
"name": "a simple action",
"description": "trigger when the variable test is higher than 2, and reset it when is less than 2",
"when_reset_bucket": "571920982c452fa00c6af660",
"when_reset_origin": "571920a5cc7d43a00c642ca1",
"when_reset_variable": "test",
"when_reset_condition": "<",
"when_reset_value": "2",
"when_set_bucket": "571920982c452fa00c6af660",
"when_set_origin": "571920a5cc7d43a00c642ca1",
"when_set_variable": "test",
"when_set_condition": ">",
"when_set_value": "2",
"type": "script",
"script": "577d4c457ee399ef1a6e6cf6",
"lock": false,
"active": true,
"tags": [
{"key":"Trigger", "value":"2"}
]
};
accactions.create(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.edit¶
Modify any property of the action.
const Account = require('tago/account');
const accactions = new Account('0e479db0-tag0-11e6-8888-790d555b633a').actions;
var data = {
"name":"New name for my action",
"description":"In this way I can change the description too",
"visible":true,
"tags": [
{"key": "client", "value": "Mark"}
]
};
accactions.edit('576dc932415f403531fd2cf6', data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.info¶
Get information about the action
const Account = require('tago/account');
const accactions = new Account('0e479db0-tag0-11e6-8888-790d555b633a').actions;
accactions.info('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.delete¶
Delete action for the account
const Account = require('tago/account');
const accactions = new Account('0e479db0-tag0-11e6-8888-790d555b633a').actions;
accactions.delete('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Analysis¶
Across the account function, it is possible to manage all your analysis. Be sure to use an account token with “write” permissions when using functions like create, edit and delete. The analysis method is completly different from the class analysis, since it only manages the analysis information and not the code that it runs.
.list¶
Retrieve a list with all analysis from account
const Account = require('tago/account');
const accanalysis = new Account('0e479db0-tag0-11e6-8888-790d555b633a').analysis;
accanalysis.list()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.create¶
Generate and retrieve a new analysis for the account
const Account = require('tago/account');
const accanalysis = new Account('0e479db0-tag0-11e6-8888-790d555b633a').analysis;
var data = {
"name":"My first analysis",
"description":"Creating my first analysis",
"active":true,
"interval": '1 minute',
"variables": [
{"key": "max_battery", "value": "3100"}
],
"tags": [
{"key": "client", "value": "Mark"}
]
};
accanalysis.create(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.edit¶
Modify any property of the analysis.
const Account = require('tago/account');
const accanalysis = new Account('0e479db0-tag0-11e6-8888-790d555b633a').analysis;
var data = {
"name":"New name for my analysis",
"description":"In this way I can change the description too",
"active":false,
"interval": '2 minutes',
"variables": [
{"key": "max_battery", "value": "3000"}
],
"tags": [
{"key": "client", "value": "Mark"}
]
};
accanalysis.edit('576dc932415f403531fd2cf6', data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.info¶
Get information about the analysis
const Account = require('tago/account');
const accanalysis = new Account('0e479db0-tag0-11e6-8888-790d555b633a').analysis;
accanalysis.info('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.delete¶
Delete analysis for the account
const Account = require('tago/account');
const accanalysis = new Account('0e479db0-tag0-11e6-8888-790d555b633a').analysis;
accanalysis.delete('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.run¶
Force Analysis to run immediately
const Account = require('tago/account');
const accanalysis = new Account('0e479db0-tag0-11e6-8888-790d555b633a').analysis;
accanalysis.run('576dc932415f403531fd2cf6')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Dashboards¶
Across the account function, it is possible to manage all your dashboards. Be sure to use an account token with “write” permissions when using functions like create, edit and delete.
.list¶
Retrieve a list with all dashboards from account
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
accdashboards.list()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.create¶
Generate and retrieve a new dashboard for the account
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
var data = {
"label":"My first dashboard",
"arrangement": [
{"widget_id": "577c28d269d2861f1b2e93b8", "x":0, "y":0, "width":2, "height":3 }
],
"tags": [
{"key": "client", "value": "Mark"}
]
};
accdashboards.create(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.edit¶
Modify any property of the dashboards.
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
var data = {
"label":"New name for my dashboards",
};
accdashboards.edit('877c28d269d2861f1b2e96b8', data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.info¶
Get information about the dashboards
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
accdashboards.info('877c28d269d2861f1b2e96b8')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.delete¶
Delete dashboards for the account
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
accdashboards.delete('877c28d269d2861f1b2e96b8')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Widgets¶
Inside dashboards, you need widgets to show and control information inside buckets. Every widget have their data slighty different from each other, to know how do they work
.create¶
Generate and retrieve a new widget for the dashboard
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
const dashboard_id = '577c28d269d2861f1b2e93ba';
var data = {
"label":"My first dashboard",
"arrangement": [
{"widget_id": "577c28d269d2861f1b2e93b8", "x":0, "y":0, "width":2, "height":3 }
],
"tags": [
{"key": "client", "value": "Mark"}
]
};
accdashboards.widgets.create(dashboard_id, data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.edit¶
Modify any property of the widget.
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
const dashboard_id = '577c28d269d2861f1b2e93ba';
const widget_id = '577c28d269d2861f1b2e93be';
var data = {
"label":"My first dashboard",
"arrangement": [
{"widget_id": "577c28d269d2861f1b2e93b8", "x":0, "y":0, "width":2, "height":3 }
],
"tags": [
{"key": "client", "value": "Mark"}
]
};
accdashboards.widgets.edit(dashboard_id, widget_id, data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.info¶
Get information about the widget
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
const dashboard_id = '576dc932415f403531fd2cf1';
const widget_id = '576dc932415f403531fd2cf6';
accdashboards.widgets.info(dashboard_id, widget_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.delete¶
Delete access widget for the dashboard
const Account = require('tago/account');
const accdashboards = new Account('0e479db0-tag0-11e6-8888-790d555b633a').dashboards;
const dashboard_id = '576dc932415f403531fd2cf1';
const widget_id = '576dc932415f403531fd2cf6';
accdashboards.widgets.delete(dashboard_id, widget_id).then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
notifications to myself¶
All accounts have an notification system, where you can see alerts of account limit and accept/refuse share of dashboards, profiles.
.list¶
Retrieve a list with all notifications from account
const Account = require('tago/account');
const notifications = new Account('0e479db0-tag0-11e6-8888-790d555b633a').notifications;
notifications.list()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.markAsRead¶
Mark a notification as read/ignored.
const Account = require('tago/account');
const notifications = new Account('0e479db0-tag0-11e6-8888-790d555b633a').notifications;
const id_list = ['5915e4a302a0a7002f2a0960', '4915e4a302a0a7002f3a0982']
notifications.markAsRead(id_list)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.accept¶
Accept the notification if it has a condition.
const Account = require('tago/account');
const notifications = new Account('0e479db0-tag0-11e6-8888-790d555b633a').notifications;
const notification_id = '5915e4a302a0a7002f2a0960'
notifications.accept(notification_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.refuse¶
Refuse the notification if it has a condition.
const Account = require('tago/account');
const notifications = new Account('0e479db0-tag0-11e6-8888-790d555b633a').notifications;
const notification_id = '5915e4a302a0a7002f2a0960'
notifications.refuse(notification_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
TagoRun Users¶
You can manage your TagoRun and Run Users. In order to modify, add, delete or do anything else with the data inside Run. See more about Tago Run here.
To setup an device object, you need a account-token (that you need to get in our website). Be sure to use tokens with the correct write/read previlegies for the current function that you want to use. For example, a token with only read previlegies can’t create, modify or delete anything from a Run.
.info¶
Get all information from the run
const Account = require('tago/account');
const accrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
accrun.info()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.listUsers¶
Retrieve a list with all users from Run
const Account = require('tago/account');
const accrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
accrun.listUsers()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.getUserInfo¶
Get run user information
const Account = require('tago/account');
const myaccrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
const user_id = '5d9c6e7945f7ab001b0a32c1';
myaccrun.getUserInfo(user_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.userEdit¶
Modify any property of the Run User.
const Account = require('tago/account');
const myaccrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
var data = {
"name":"New name for my Run User",
"tags": [
{"key": "client", "value": "Mark"}
]
};
const user_id = '5d9c6e7945f7ab001b0a32c1';
myaccrun.userEdit(user_id, data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.createUser¶
Create a new Run User.
const Account = require('tago/account');
const myaccrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
var data = {
"name":"John Doe",
"email": "jhon@doe.com",
"password": "123abc",
"tags": [
{"key": "employee", "value": "Manager"}
]
};
myaccrun.userEdit(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.deleteUser¶
Delete run user
const Account = require('tago/account');
const myaccrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
const user_id = '5d9c6e7945f7ab001b0a32c1';
myaccrun.deleteUser(user_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Notification to users¶
You can push notification messages directly to the users registered in your Run. See more about notification for users here.
.notificationList¶
Retrieve a list with all notifications for the Run user
const Account = require('tago/account');
const accrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
const user_id = '5d9c6e7945f7ab001b0a32c1';
accrun.notificationList(user_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.notificationEdit¶
Modify any property of the user push notification.
const Account = require('tago/account');
const myaccrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
const data = {
"title": "Temperature Alert",
"message": "The temperature is too high"
"buttons": [{
"label": "Go to device dashboard",
"url": "https://admin.tago.io/dashboard/info/5d9c6e7945f7ab001b0a32c2",
"color": "red",
// "analysis": "5d9c6e7945f7ab001b0a32c2",
}],
};
const notification_id = '5d9c6e7945f7ab001b0a32c1';
myaccrun.notificationEdit(notification_id, data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.notificationCreate¶
Create a new push notification for the user.
const Account = require('tago/account');
const myaccrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
const data = {
"title": "Temperature Alert",
"message": "The temperature is too high"
"buttons": [{
"label": "Go to device dashboard",
"url": "https://admin.tago.io/dashboard/info/5d9c6e7945f7ab001b0a32c2",
"color": "red",
// "analysis": "5d9c6e7945f7ab001b0a32c2",
}],
};
myaccrun.notificationCreate(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.notificationDelete¶
Delete push notifcation for the run user
const Account = require('tago/account');
const accrun = new Account('0e479db0-tag0-11e6-8888-790d555b633a').run;
const notification_id = '5d9c6e7945f7ab001b0a32c1';
accrun.notificationDelete(notification_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
Access Management¶
Access Management (AM) is a module that helps you securely grant access to certain resources in your account. You create Targets (users or things) and determine which type of Permissions for the resources they will have. See more about Access Management here.
.list¶
Retrieve a list with all access management from account.
const Account = require('tago/account');
const accam = new Account('0e479db0-tag0-11e6-8888-790d555b633a').accessManagement;
accam.list()
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.create¶
Generate and retrieve a new access management for the account.
const Account = require('tago/account');
const accam = new Account('0e479db0-tag0-11e6-8888-790d555b633a').AccessManagement;
const user = {
id: '576dc932415f403531fd2cf6',
name: 'John Doe',
};
const data = {
name: `Dashboards for the user ${user.name}`,
tags: [{ key: 'client_id', value: user.id }],
targets: [
[
'run_user',
'id',
user.id,
],
],
permissions: [
{
effect: 'allow',
action: [
'access',
],
resource: [
'dashboard',
'tag.key',
'client_id',
'tag.value',
user.id,
],
},
],
};
accam.create(data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.edit¶
Modify any property of the access management.
const Account = require('tago/account');
const accam = new Account('0e479db0-tag0-11e6-8888-790d555b633a').AccessManagement;
const am_id = '576dc932415f403531fd2cf6'
const data = {
name: 'my new name of access management',
};
accam.create(am_id, data)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.info¶
Get information about the access management
const Account = require('tago/account');
const accam = new Account('0e479db0-tag0-11e6-8888-790d555b633a').AccessManagement;
const access_management_id = '576dc932415f403531fd2cf6';
accam.info(access_management_id)
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});
.delete¶
Delete access management for the account
const Account = require('tago/account');
const accam = new Account('0e479db0-tag0-11e6-8888-790d555b633a').AccessManagement;
const access_management_id = '576dc932415f403531fd2cf6';
accam.delete(access_management_id')
.then((result) => {
//You can treat the result here
})
.catch((error) => {
//You can treat errors here
});