hologram-node v1.3.2
hologram-node:
Holograms API client library for node.js
Install:
npm install hologram-node --save
Getting started:
var Hologram = require('hologram-node');
var HologramAPI = Hologram("Your API key from the dashboard", {
orgid: "Your orgId from the dashboard"
});
Notes:
- All endpoints return Promises. use
.then((data) => {}).catch((error) => {})
- All API methods are abstractions of the RAW endpoints you can utilize. Docs at https://hologram.io/docs/reference/cloud/http
Examples:
var Hologram = require('hologram-node');
var HologramAPI = Hologram("Your API key from the dashboard", {
orgid: "Your orgId from the dashboard"
});
HologramAPI.Devices.getAll().then((devices) => {
console.log(devices);
});
HologramAPI.Devices.getOne("123").then((devices) => {
console.log(device);
});
HologramAPI.Account.me().then((accountInfo) => {
console.log(accountInfo);
});
API:
HologramAPI.Account.me()
Gets current user information.
HologramAPI.Account.getBalance()
Retreive the current amount of credit you have on your account.
HologramAPI.Account.getBalanceHistory()
Retreive a history of transactions (credits and charges).
HologramAPI.Account.getBillingInfo()
Retreive the truncated version of your selected payment method.
HologramAPI.Account.getOrders()
Retreive the orders you have placed.
HologramAPI.Account.addBalance(amountToAdd)
Charge the user's configured billing source and add that amount to your account balance.
Required:
- amountToAdd number
HologramAPI.Activate.getPlans()
The Data Plans endpoints return pricing and descriptions for the different data plans that Hologram offers. When changing the data plan for a cellular link via API, you must refer to the plan by its ID, which you can determine from these endpoints.
HologramAPI.Activate.getPlan(planId)
Required:
- planId string
HologramAPI.Activate.preview(sims, plan, zone, useAccountBalance)
Preview the price and validity of an activation
Required:
HologramAPI.Activate.activate(sims, plan, zone, useAccountBalance)
Activate the selected sims. Charges your configured billing method.
Required:
HologramAPI.Device.getOne(deviceid)
Get one of your devices.
Required:
- deviceid string
HologramAPI.Device.getAll(options)
Options:
HologramAPI.Device.getRouterCreds(deviceid)
Required:
- deviceid string
HologramAPI.Device.genRouterCreds(deviceid)
Required:
- deviceid string
HologramAPI.Device.linkTag(tagid, deviceids)
Required:
HologramAPI.Device.unlinkTag(tagid, deviceids)
Required:
HologramAPI.Device.changeName(deviceid, name)
Required:
HologramAPI.Device.sendSMS(deviceid, message, options)
Required:
Options:
- fromNumber string
HologramAPI.Device.sendData(deviceids, data, port, protocol)
Send a TCP or UDP message to one or more devices on the Hologram network. See the guide for details.
Required:
HologramAPI.Device.sendDataViaWebhook(deviceid, webhookguid, data)
This endpoint does not require authentication with your API key, as the webhook GUID serves as an authentication token. In order to generate a webhook URL, please visit the cloud configuration page for your device.
Required:
HologramAPI.Device.getPhoneNumberCost(deviceid, country, options)
Required:
Options:
- areacode string
HologramAPI.Device.addPhoneNumber(deviceid, country, options)
Required:
Options:
- areacode string
HologramAPI.Device.removePhoneNumber(deviceid)
Required:
- deviceid string
HologramAPI.Device.setTunnelable(deviceid, tunnelable)
Required:
HologramAPI.Link.getAll()
HologramAPI.Link.getOne(linkId)
Required:
- linkId string
HologramAPI.Link.getUsage(linkid)
Required:
- linkid string
HologramAPI.Link.pause(linkid)
Required:
- linkid string
HologramAPI.Link.resume(linkid)
Required:
- linkid string
HologramAPI.Link.setOverageLimit(linkId, limit)
Required:
HologramAPI.Link.getStatusHistory(linkId)
Required:
- linkId string
HologramAPI.Link.changePlanPreview(linkid, planid, zone)
Preview costs and information of changing a links plan .
Required:
HologramAPI.Link.changePlan(linkid, planid, zone)
Change the plan of a selected cellular link. Charges your user balance.
Required:
HologramAPI.Log.getAll(options)
Options:
- deviceid string
HologramAPI.Log.getForDevice(deviceid)
Required:
- deviceid string
HologramAPI.Org.getAll()
List all organizations that you are a member of. This includes the special "personal" organization tied to your user.
HologramAPI.Org.getOne(orgid)
Required:
- orgid string
HologramAPI.Org.getPending()
HologramAPI.Report.billing()
HologramAPI.Report.devices()
HologramAPI.Tag.getAll()
HologramAPI.Tag.create(name)
Required:
- name string
HologramAPI.Tag.update(tagId, name)
Required:
HologramAPI.Tag.remove(tagId)
Required:
- tagId string
HologramAPI.Webhook.get(deviceid)
Required:
- deviceid string
HologramAPI.Webhook.create(deviceid, port, protocol)
Required:
HologramAPI.Webhook.update(deviceid, port, protocol)
Required:
HologramAPI.Webhook.regenerate(deviceid)
Required:
- deviceid string
HologramAPI.Webhook.remove(deviceid)
Required:
- deviceid string