API questions

Hi,

A couple of questions:

  1. Is it possible to pull the SIM ICCID number as well as the IMSI via the device detail API call? We have a user facing portal for managing SIM activations /usage and would like to be able to pull InControl usage data and reconcile it with carrier provided data. The carrier API’s we use all work off the ICCID as opposed to the IMSI, so while we can track usage more or less by SIM using the InControl API, we can’t map that to the actual SIM in the case where customers have multiple active SIMs from the same carrier.

  2. Are there any restrictions on polling the API for data? At the moment we’re designing a solution to poll the list of devices and each devices usage for each cellular WAN on an hourly basis. Just want to be sure we don’t end up in violation of the API t&c’s.

Thanks.

Hi

Are you using the WAN usage or bandwidth usage query?

For the bandwidth:

https://api.ic.peplink.com/rest/o/{ID}/g/{group}/d/{device}/bandwidth?type=monthly&wan_id=3

It seems tofall into error all the time due to invalid type. EDIT: it doesn’t work for the web testing interface but works in a regular call.

Beware that WAN usage query returns info in GB and not in MB as stated.

Per SIM (A or B) usage tracking is very much needed indeed.

I’m using the bandwidth usage query to pull usage for each WAN (so 4 calls for an HD4 with all cellular WAN’s enabled). I’d like to get the SIM ICCID off the device info call - because we poll hourly I can use that to get reasonably accurate per SIM usage as we persist summary data into our own DB. The problem is when we enter a SIM into our system we do so by scanning the barcodes on the SIM card, but that only includes the ICCID, PIN and PUK, not the IMSI that the PepLink device and InControl API shows. So to make it all work there is a manual step after installing the SIM in the router to enter the IMSI into a mapping table - which is error prone.

I have the exact same problem. And it is not even visible all the time from the device.

  1. Currently the firmware does not support to read ICCID. So It is not possible to read from the API yet. But we are going to add the information in the firmware in the future. When the value is available, it will be available from the “/rest/o/{organization_id}/g/{group_id}/d/{device_id}” call.

  2. You can call the API no more than 10 times per second. So you’re safe. :smiley:

1 Like

Hi Paille, the web testing interface for the bandwidth API call has been fixed. Thanks for your report.

1 Like

Are you sure?
https://api.ic.peplink.com/rest/o/!!!!!/g/!!!!/d/!!!!!/usage/csv?start=2015-06-04T08:48:46&end=2015-06-11T08:48:46

is still answering in GB but displays MB

Last time we fixed the web testing tool in calling the “bandwidth” API.

We just corrected the unit of the returned values in a couple of calls, including “/usage” and “/usage/csv”. Please check.

Thanks for you report.

1 Like

Hello, 3 years later, no “by Sim A/B filtered WAN Usage” ? It’s available in the Device, why not in incontrol ?

Thanks.

InControl will provide per-SIM-slot WAN usages in the next major release.

2 Likes