onetap-cloud-api
v1.0.5
Published
An Unofficial Nodejs Wrapper for Onetap.com's Cloud API
Downloads
11
Readme
Setup
Installation
npm i onetap-cloud-api
Getting an Authorization Keys
Your Onetap Cloud API Keys Can Be Found By going to (https://www.onetap.com/account/cloud) Then clicking Generate
Usage
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)
});
Documentation
The Offical Onetap Cloud Documention can be Found Here
Methods
OnetapAPI.DeleteScriptInvite(script_id, invite_id)
Onetap.DeleteScriptInvite("Script_ID", "Invite_ID").then(result => {
console.log(result)
})
Delete a certain Script's Invite
| 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)
OnetapAPI.CreateScriptInvite("script_id", max_age, max_uses).then(result => {
console.log(result)
})
Create a Script Invite
| 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)
OnetapAPI.UpdateScript("script_id", "name").then(result => {
console.log(result)
})
Update a Script
| Pamaremter | Type | Description | | :--- | :--- | :--- | | script_id | str | The ID of the script.| | name | str | Name of the script.|
OnetapAPI.GetAllScripts()
OnetapAPI.GetAllScripts().then(result => {
console.log(result)
})
Gets all Scripts you Currently Own or Subscribed to. (Does not require Parameters)
OnetapAPI.GetScript(script_id)
OnetapAPI.GetScript("script_id").then(result => {
console.log(result)
})
Gets a certain Script by their script_id
.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | script_id | str | The ID of the script. |
OnetapAPI.GetScriptInvites(script_id)
OnetapAPI.GetScriptInvites("script_id").then(result => {
console.log(result)
})
Gets all the active invites for a certain Script.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | script_id | str | The ID of the script.|
OnetapAPI.GetAllScriptsInvites()
OnetapAPI.GetAllScriptsInvites().then(result => {
console.log(result)
})
Gets all the active invites for every Script you own. (Does not require Parameters)
OnetapAPI.GetAllScriptsSubscriptions()
OnetapAPI.GetAllScriptsSubscriptions().then(result => {
console.log(result)
})
Gets all the active Subscriptions for every Script you own. (Does not require Parameters)
OnetapAPI.GetScriptSubscriptions(script_id)
OnetapAPI.GetScriptSubscriptions("script_id").then(result => {
console.log(result)
})
Gets all the active Subscriptions for a certain Script.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | script_id | str | The ID of the script.|
OnetapAPI.CreateScriptSubscription(script_id, user_id)
OnetapAPI.CreateScriptSubscription("script_id", "user_id").then(result => {
console.log(result)
})
Creates a Script Subscription for a included user_id
| 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)
OnetapAPI.DeleteScriptSubscription("script_id", "user_id").then(result => {
console.log(result)
})
Deletes a Script Subscription for a included user_id
| Pamaremter | Type | Description | | :--- | :--- | :--- | | script_id | str | The ID of the script.| | user_id | str | The ID of the User.|
OnetapAPI.GetAllConfigs()
OnetapAPI.GetAllConfigs().then(result => {
console.log(result)
})
Gets all Configs that you own or are currently subscribed to. (Does not require Parameters)
OnetapAPI.GetConfig(config_id)
OnetapAPI.GetConfig("config_id").then(result => {
console.log(result)
})
Gets details about a certain config you own or are subscribed to.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | config_id | str | The ID of the config.|
OnetapAPI.DeleteConfig(config_id)
OnetapAPI.DeleteConfig("config_id").then(result => {
console.log(result)
})
Deletes a certain config you own or are subscribed to.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | config_id | str | The ID of the config.|
OnetapAPI.UpdateConfig(config_id, name, data)
OnetapAPI.UpdateConfig("config_id", "name", "data").then(result => {
console.log(result)
})
Updates a certain config you own.
| 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()
OnetapAPI.GetAllConfigsInvites().then(result => {
console.log(result)
})
Gets all currently valid invites to every Config you Own. (Does not require Parameters)
OnetapAPI.GetConfigInvites(config_id)
OnetapAPI.GetConfigInvites("config_id").then(result => {
console.log(result)
})
Gets all currently valid invites For a certain Config.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | config_id | str | The ID of the config.|
OnetapAPI.CreateConfigInvite(config_id, max_uses, max_age)
OnetapAPI.CreateConfigInvite("config_id", max_uses, max_age).then(result => {
console.log(result)
})
Creates a invite For a certain Config.
| 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)
OnetapAPI.DeleteConfigInvite("config_id", "invite_id").then(result => {
console.log(result)
})
Deletes a Certain Config Invite.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | config_id | str | The ID of the config.| | invite_id | str | The ID of the invite.|
OnetapAPI.GetAllConfigSubscriptions()
OnetapAPI.GetAllConfigSubscriptions().then(result => {
console.log(result)
})
Gets all current Subscribed Configs. (Does not require Parameters)
OnetapAPI.GetConfigSubscriptions(config_id)
OnetapAPI.GetConfigSubscriptions("config_id").then(result => {
console.log(result)
})
Gets all Subscribtions to a Certain Config.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | config_id | str | The ID of the config.|
Gets all current Subscribed Configs. (Does not require Parameters)
OnetapAPI.CreateConfigSubscription(config_id, user_id)
OnetapAPI.CreateConfigSubscription("config_id", "user_id").then(result => {
console.log(result)
})
Creates a Config Subscription for a included user_id
| 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)
OnetapAPI.DeleteScriptSubscription("config_id", "user_id").then(result => {
console.log(result)
})
Deletes a Certain Config Subscription.
| Pamaremter | Type | Description | | :--- | :--- | :--- | | config_id | str | The ID of the config.| | user_id | str | The ID of the user.|
Examples
examples will be added shortly