Using Our APIs
Information Requests
Query Usage
6 min
purpose returns the latest known usage values for a specified sim for the current calendar month the response includes data usage sms usage voice usage the returned values are generally current to within the last few hours the target sim is specified using the \<iccid> element returned values the response includes the following elements \<data mb> — data usage in megabytes (mb) \<sms> — total chargeable sms (sms mo, sms moip and sms mt) \<voice mins> — voice usage in minutes, rounded up to the next whole minute usage guidance this query may involve onward api calls to service provider partners as a result it is relatively resource intensive it may be subject to request rate limits this query is not intended to provide real time, minute by minute usage updates it should not be used as a high frequency polling mechanism, particularly for large sim populations if your use case requires frequent usage monitoring, please discuss your requirements with support before implementation endpoint post https //api m2miportal com content type application/xml accept application/xml request (xml) \<query usage version="1" api id="123456"> \<authentication> \<username>username\</username> \<password>password\</password> \</authentication> \<iccid>1234567890123456789\</iccid> \</query usage> response (success) \<query usage response api id="123456"> \<api outcome>success\</api outcome> \<data mb>80 010\</data mb> 	\<sms>5\</sms> 	\<voice mins>31\</voice mins> \</query usage response> response (failure) if a request cannot be processed, the response will include api outcome indicating failure an error description explaining the reason failure responses may occur due to invalid authentication credentials invalid or unknown identifiers (for example iccid or msisdn) invalid or missing parameters values not permitted for the specified sim type or account configuration insufficient permissions integrating systems should validate input data before submission and implement appropriate error handling and logging