Skip to Content
GEMMUsage & ReportingUsage Details API

Usage Detail

POST/usage/actions/usage-detailUsage & ReportingOpenAPI

Download usage detail for the SIMs in an account.

Auth Scope
urn:grt:gemm
Content-Type
application/json
Base URL
https://gemmapi2.granitenet.com/v2/api/gemm/v1

Uses and Requirements

Use this API to download usage detail for the SIMs in an account. You can download usage for up to 6 billing cycles, including the current one. The API is synchronous and no callback is sent. Because the result can be large, the API returns one page at a time. Use pagingInformation to set the page number and page size.

HTTP Status Codes

StatusWhen
200The request succeeded. Usage detail for the matching SIMs is returned one page at a time; if none match, usageDetail is empty. This API is synchronous and no callback is sent.
400Validation failed: parentAccountNumber is missing or not an 8-digit number; accountNumber is not an 8-digit number; iccid is not 19-20 digits (an F is allowed as the 20th character); connection is not 19 to 32 digits; msisdn is not 10 digits; planType is longer than 10 characters; user, model or searchValue is longer than 100 characters; sortingInformation.sortBy is not a sortable column; pageNumber is less than 1 or pageSize is less than 10; the macnum header is missing or not an 8-digit number; or the request body is missing or is not valid JSON (for example cycle is not a date or tags is not an array).
401The bearer token is missing, invalid or expired, or you do not have access to the account in the macnum header.
403You do not have access to parentAccountNumber, parentAccountNumber does not belong to the hierarchy of the macnum header, or your credentials are not enabled for API access.
429Too many requests were sent in a short period. Wait briefly and retry.
500An unexpected server error occurred.
503The system is under scheduled maintenance. Retry after the maintenance window.
504A dependent service did not respond in time. Retry the request.

Headers

HeaderValue
AuthorizationBearer access-token
Content-Typeapplication/json
macnumTop Level Account Number associated with your API credentials.

Request Body Parameters

ParameterTypeRequiredDescription
parentAccountNumberstringYesThe parent account number whose subscribers' usage detail you want to retrieve.
planTypestringNoPossible values are
  • Individual
  • Pooled
planLimitnumberNoOnly for internal use.
cyclestringNoBilling cycle date in YYYY-MM-DD format.
accountNumberstringNoA child account number to retrieve data for that specific child account.
userstringNoDevice user.
connectionstringNo19 to 32 digits.
msisdnstringNo10 digits.
modelstringNoDevice model.
iccidstringNoA specific ICCID to filter results to. 19-20 digits; an F is allowed as the 20th character.
searchValuestringNoFree-text search value, matched against the connection's account, device and plan fields.
tagsarray of stringsNoFilter results to connections with these tags, for example ["warehouse"]. A plain string is not accepted and returns 400.
sortingInformationobjectNoSorting details for the request. If omitted, results are sorted by cycle.
sortBystringNoThe column to sort results by, for example Cycle, Iccid or status. An unknown column returns 400 ("SortBy must be one of the sortable overall usage columns.").
sortDirectionstringNoASC (default) or DESC.
pagingInformationobjectNoPaging details for the request. If omitted, page 1 with 10 records is returned.
pageNumbernumberYesRequired when pagingInformation is provided. The page to retrieve. The first response returns pageCount inside pagingInformation, which tells you how many pages match your filters. Increment pageNumber on each call to fetch the next page.
pageSizenumberYesRequired when pagingInformation is provided. The number of records to retrieve in a single API call. Must be at least 10. Recommended value: 25.

Request Examples

Responses

Success Response (200 OK)

Response Fields

ParameterTypeDescription
usageDetailarrayOne entry per connection matching the request criteria.
accountNumberstringThe account number the connection belongs to.
accountNamestringName of the account.
parentAccountNumberstringThe parent account number.
parentAccountNamestringName of the parent account.
iccidstringThe ICCID of the SIM. Not returned for SIM360 accounts, which return connection.
connectionstringThe connection identifier. Returned for SIM360 accounts instead of iccid.
providerstringThe carrier the SIM is provisioned with.
msisdnstringThe mobile number of the connection.
imeistringThe IMEI (equipment ID) of the device.
planNamestringName of the rate plan the connection is on.
planTypestringIndividual or Pooled.
planLimitnumberThe usage limit of the plan. Not present when the plan has no fixed limit.
planUsagestringUsage recorded for the plan in the billing cycle.
planUsagePercentagestringPercentage of the plan limit that has been used.
simLimitstringThe usage limit assigned to the SIM. Unlimited or N/A when the SIM has no fixed limit.
simUsagestringUsage recorded for the SIM in the billing cycle.
simUsagePercentagestringPercentage of the SIM limit that has been used.
usernamestringDevice user.
statusstringCurrent status of the SIM, for example Activated.
planAliasstringAlias of the plan.
simAliasstringAlias of the SIM.
cycleDatestringThe start date of the billing cycle.
cyclestringThe billing cycle the usage belongs to.
manufacturerstringManufacturer of the device.
modelstringDevice model.
ipTypestringIP type of the connection, for example Dynamic or Static. Prefixed with the network type when one applies.
ipAddressstringIP address assigned to the connection.
subnetMaskstringSubnet mask of the connection.
defaultGatewaystringDefault gateway of the connection.
cycleDaystringThe day of the month the billing cycle starts.
locationstringLocation of the device.
modelNumberstringModel number of the device.
bundleTypestringBundle type of the connection.
equipmentIdstringEquipment ID of the device.
eqiupmentProductstringEquipment product of the device. The field name is spelled as returned by the API.
customField1stringUser-defined custom field.
customField2stringUser-defined custom field.
generalLedgerstringGeneral ledger value held against the connection (custom field 3).
branchNumberstringBranch number held against the connection (custom field 4).
employerstringEmployer held against the connection (custom field 5).
tagsstringTags assigned to the connection.
pagingInformationobjectPaging details for the result set.
pageNumberintegerThe page returned.
pageSizeintegerThe page size used for the request.
pageCountintegerTotal number of pages available for the given criteria.
recordCountintegerTotal number of records across all pages.

Failure Responses

Error Message

Error Response Fields

ParameterTypeDescription
resultobjectResult status object.
statusstringResult status: success or failure.
errorsobjectList of errors.
errorCodestringError code.
errorMessagestringError message.

Code Examples

Last updated on