hologram-node

1.3.2 • Public • Published

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:

  1. All endpoints return Promises. use .then((data) => {}).catch((error) => {})
  2. 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.

view docs


HologramAPI.Account.getBalance()

Retreive the current amount of credit you have on your account.

view docs


HologramAPI.Account.getBalanceHistory()

Retreive a history of transactions (credits and charges).

view docs


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]

view docs


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.

view docs


HologramAPI.Activate.getPlan(planId)

Required:

  • planId [string]

view docs


HologramAPI.Activate.preview(sims, plan, zone, useAccountBalance)

Preview the price and validity of an activation

Required:

  • sims [array]
  • plan [number]
  • zone [string]
  • useAccountBalance [boolean]

view docs


HologramAPI.Activate.activate(sims, plan, zone, useAccountBalance)

Activate the selected sims. Charges your configured billing method.

Required:

  • sims [array]
  • plan [number]
  • zone [string]
  • useAccountBalance [boolean]

view docs


HologramAPI.Device.getOne(deviceid)

Get one of your devices.

Required:

  • deviceid [string]

view docs


HologramAPI.Device.getAll([options])

Options:

  • limit [string]
  • startafter [string]

view docs


HologramAPI.Device.getRouterCreds(deviceid)

Required:

  • deviceid [string]

HologramAPI.Device.genRouterCreds(deviceid)

Required:

  • deviceid [string]

HologramAPI.Device.linkTag(tagid, deviceids)

Required:

  • tagid [string]
  • deviceids [array]

view docs


HologramAPI.Device.unlinkTag(tagid, deviceids)

Required:

  • tagid [string]
  • deviceids [array]

view docs


HologramAPI.Device.changeName(deviceid, name)

Required:

  • deviceid [string]
  • name [string]

HologramAPI.Device.sendSMS(deviceid, message, [options])

Required:

  • deviceid [string]
  • message [string]

Options:

  • fromNumber [string]

view docs


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:

  • deviceids [array]
  • data [string]
  • port [string]
  • protocol [string]

view docs


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:

  • deviceid [string]
  • webhookguid [string]
  • data [string]

view docs


HologramAPI.Device.getPhoneNumberCost(deviceid, country, [options])

Required:

  • deviceid [string]
  • country [string]

Options:

  • areacode [string]

HologramAPI.Device.addPhoneNumber(deviceid, country, [options])

Required:

  • deviceid [string]
  • country [string]

Options:

  • areacode [string]

HologramAPI.Device.removePhoneNumber(deviceid)

Required:

  • deviceid [string]

HologramAPI.Device.setTunnelable(deviceid, tunnelable)

Required:

  • deviceid [boolean]
  • tunnelable [boolean]

HologramAPI.Link.getAll()

view docs


HologramAPI.Link.getOne(linkId)

Required:

  • linkId [string]

view docs


HologramAPI.Link.getUsage(linkid)

Required:

  • linkid [string]

HologramAPI.Link.pause(linkid)

Required:

  • linkid [string]

view docs


HologramAPI.Link.resume(linkid)

Required:

  • linkid [string]

view docs


HologramAPI.Link.setOverageLimit(linkId, limit)

Required:

  • linkId [string]
  • limit [string]

view docs


HologramAPI.Link.getStatusHistory(linkId)

Required:

  • linkId [string]

HologramAPI.Link.changePlanPreview(linkid, planid, zone)

Preview costs and information of changing a links plan .

Required:

  • linkid [string]
  • planid [number]
  • zone [string]

view docs


HologramAPI.Link.changePlan(linkid, planid, zone)

Change the plan of a selected cellular link. Charges your user balance.

Required:

  • linkid [string]
  • planid [number]
  • zone [string]

view docs


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.

view docs


HologramAPI.Org.getOne(orgid)

Required:

  • orgid [string]

view docs


HologramAPI.Org.getPending()


HologramAPI.Report.billing()


HologramAPI.Report.devices()


HologramAPI.Tag.getAll()

view docs


HologramAPI.Tag.create(name)

Required:

  • name [string]

view docs


HologramAPI.Tag.update(tagId, name)

Required:

  • tagId [string]
  • name [string]

HologramAPI.Tag.remove(tagId)

Required:

  • tagId [string]

view docs


HologramAPI.Webhook.get(deviceid)

Required:

  • deviceid [string]

HologramAPI.Webhook.create(deviceid, port, protocol)

Required:

  • deviceid [string]
  • port [string]
  • protocol [string]

HologramAPI.Webhook.update(deviceid, port, protocol)

Required:

  • deviceid [string]
  • port [string]
  • protocol [string]

HologramAPI.Webhook.regenerate(deviceid)

Required:

  • deviceid [string]

HologramAPI.Webhook.remove(deviceid)

Required:

  • deviceid [string]

Readme

Keywords

Package Sidebar

Install

npm i hologram-node

Weekly Downloads

2

Version

1.3.2

License

ISC

Last publish

Collaborators

  • ozymandias547