npm i onetap-cloud-api
Your Onetap Cloud API Keys Can Be Found By going to (https://www.onetap.com/account/cloud) Then clicking Generate
const OnetapCloud = require('onetap-cloud-api');
const OnetapAPI = new OnetapCloud(apiId, apiSecret, apiKey);
(you need to provide the X-Api-Id, X-Api-Secret and X-Api-Key to the Object)
We call Methods with the ot Object
Heres a example of the GetAllScripts Function.
OnetapAPI.GetAllScripts().then(result => {
console.log(result)
});
The Offical Onetap Cloud Documention can be Found Here
Onetap.DeleteScriptInvite("Script_ID", "Invite_ID").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
| invite_id |
str |
The ID of the particular invite you want to delete. |
OnetapAPI.CreateScriptInvite("script_id", max_age, max_uses).then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
| max_age |
int |
Maximum age of invite. 1 - 1 hour, 2 - 3 hours, 3 - 6 hours, 4 - 12 hours, 5 - 24 hours, 6 - 48 hours |
| max_uses |
int |
Maximum uses of invite. 1 - 1 use, 2 - 5 uses, 3 - 10 uses, 4 - 25 uses, 5 - 50 uses, 6 - 100 uses |
OnetapAPI.UpdateScript("script_id", "name").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
| name |
str |
Name of the script. |
OnetapAPI.GetAllScripts().then(result => {
console.log(result)
})
OnetapAPI.GetScript("script_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
OnetapAPI.GetScriptInvites("script_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
OnetapAPI.GetAllScriptsInvites().then(result => {
console.log(result)
})
OnetapAPI.GetAllScriptsSubscriptions().then(result => {
console.log(result)
})
OnetapAPI.GetScriptSubscriptions("script_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
OnetapAPI.CreateScriptSubscription("script_id", "user_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
| user_id |
str |
The ID of the User. |
OnetapAPI.DeleteScriptSubscription("script_id", "user_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| script_id |
str |
The ID of the script. |
| user_id |
str |
The ID of the User. |
OnetapAPI.GetAllConfigs().then(result => {
console.log(result)
})
OnetapAPI.GetConfig("config_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
OnetapAPI.DeleteConfig("config_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
OnetapAPI.UpdateConfig("config_id", "name", "data").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
| name |
str |
The name of the Config. |
| data |
str |
The Config Data. |
OnetapAPI.GetAllConfigsInvites().then(result => {
console.log(result)
})
OnetapAPI.GetConfigInvites("config_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
OnetapAPI.CreateConfigInvite("config_id", max_uses, max_age).then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the Config. |
| max_age |
int |
Maximum age of invite. 1 - 1 hour, 2 - 3 hours, 3 - 6 hours, 4 - 12 hours, 5 - 24 hours, 6 - 48 hours |
| max_uses |
int |
Maximum uses of invite. 1 - 1 use, 2 - 5 uses, 3 - 10 uses, 4 - 25 uses, 5 - 50 uses, 6 - 100 uses |
OnetapAPI.DeleteConfigInvite("config_id", "invite_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
| invite_id |
str |
The ID of the invite. |
OnetapAPI.GetAllConfigSubscriptions().then(result => {
console.log(result)
})
OnetapAPI.GetConfigSubscriptions("config_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
OnetapAPI.CreateConfigSubscription("config_id", "user_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
| user_id |
str |
The ID of the user. |
OnetapAPI.DeleteScriptSubscription("config_id", "user_id").then(result => {
console.log(result)
})
| Pamaremter |
Type |
Description |
| config_id |
str |
The ID of the config. |
| user_id |
str |
The ID of the user. |
examples will be added shortly