1.0.5 • Published 3 years ago

onetap-cloud-api v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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

PamaremterTypeDescription
script_idstrThe ID of the script.
invite_idstrThe 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

PamaremterTypeDescription
script_idstrThe ID of the script.
max_ageintMaximum age of invite. 1 - 1 hour, 2 - 3 hours, 3 - 6 hours, 4 - 12 hours, 5 - 24 hours, 6 - 48 hours
max_usesintMaximum 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

PamaremterTypeDescription
script_idstrThe ID of the script.
namestrName 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.

PamaremterTypeDescription
script_idstrThe 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.

PamaremterTypeDescription
script_idstrThe 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.

PamaremterTypeDescription
script_idstrThe 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

PamaremterTypeDescription
script_idstrThe ID of the script.
user_idstrThe 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

PamaremterTypeDescription
script_idstrThe ID of the script.
user_idstrThe 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.

PamaremterTypeDescription
config_idstrThe 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.

PamaremterTypeDescription
config_idstrThe 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.

PamaremterTypeDescription
config_idstrThe ID of the config.
namestrThe name of the Config.
datastrThe 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.

PamaremterTypeDescription
config_idstrThe 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.

PamaremterTypeDescription
config_idstrThe ID of the Config.
max_ageintMaximum age of invite. 1 - 1 hour, 2 - 3 hours, 3 - 6 hours, 4 - 12 hours, 5 - 24 hours, 6 - 48 hours
max_usesintMaximum 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.

PamaremterTypeDescription
config_idstrThe ID of the config.
invite_idstrThe 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.

PamaremterTypeDescription
config_idstrThe 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

PamaremterTypeDescription
config_idstrThe ID of the config.
user_idstrThe 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.

PamaremterTypeDescription
config_idstrThe ID of the config.
user_idstrThe ID of the user.

Examples

examples will be added shortly

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago