Modifying multiple SIMs at once is great for managing large fleets of devices. In this guide, we walk through changing data plans in bulk using the Hologram REST API.
Note: If you aren't familiar with APIs, we highly recommend checking out our Introduction to Hologram's REST API guide as well as using Postman to make the API calls mentioned in this guide.
All API requests require your API Key to be included in the header, which is detailed in the introduction guide. For brevity's sake, this guide does not include the header information.
Changing device data plans using the API example
1) To change data plans in bulk we will first need to get a list of the linkids
for the devices we want to modify. This can be done in several ways, but we recommend either exporting your devices' information as a CSV
by clicking the Export CSV button at the bottom left-hand side of your dashboard's Devices page.
GET https://dashboard.hologram.io/api/1/devices?orgid={YOUR_ORGID}
2) Once you have the list of linkids
for the SIMs you want to modify, you will need to get the data plan's information. You can do this with the request:
GET https://dashboard.hologram.io/api/1/plans?orgid={YOUR_ORGID}
This will return a list of all the data plans you have access to. For our bulk plan change, we'll need the id
field and the zones
field which should be either global
, USA
, 1
, or 2
.
We now have everything we need!
3) To change the data plans, we need to make the following REST API request:
POST https://dashboard.hologram.io/api/1/links/cellular/changeplan
with the following body:
Body
{
"linkids": [{LINKID_1},{LINKID_2},{LINKID_n}],
"plan": {PLAN_ID},
"tier": "{PLAN_ZONE}",
"orgid": {YOUR_ORGID}
}