Overview #
overview of the apis #
Path | API Name |
---|---|
Order status push callback hook v3.0 (Not yet) | Order status push |
SMS MT data push callback hook v1.0 (Not yet) | SMS MT data push |
SMS MO data push callback hook v1.0 (Not yet) | SMS MO data push |
/cmp-api/sims/{sim_id}/cdr |
Query details on single SIM card flow CDRS |
/cmp-api/sims/{sim_id}/voiceCdr |
Query details on single SIM card voice CDRS |
/cmp-api/sims/{sim_id}/cdr/apn |
Query the CDR by single simId and apn |
/cmp-api/package/syncPackages |
Synchronized traffic package information |
/cmp-api/package/batchOrderPackages |
Bulk order packages |
/cmp-api/package/orderExtraPackage |
Order an extra package |
/cmp-api/package/queryOrder |
Query package order information |
/cmp-api/package/openPackage |
Open data plan |
/cmp-api/package/renewPackage |
Renew the specified order |
/cmp-api/package/cancelPackage |
Cancel package order |
/cmp-api/package/aheadFinishDeviceOrder |
End package orders early |
/cmp-api/sms/sendSms |
Send SMS message |
/cmp-api/sms/queryMTSmsStatus |
Query MT Record |
/cmp-api/sms/querySmsCDR |
Query MO、MT CDR |
/cmp-api/sms/queryLatestCDR |
Query the latest CDR |
/cmp-api/device/restartService |
Restart a suspended order |
/cmp-api/device/queryDevice |
Query device information based on device_id |
/cmp-api/device/pauseService |
Suspend an active order |
/cmp-api/device/queryBatchDevice |
Batch query device information |
/cmp-api/device/bind |
Bind the device via IMEI |
/cmp-api/device/getBindTrackList |
Get Binding History |
`` | Get traffic threshold notification |
Order status push #
When the status of CMP’s order changes,CMP will notify via the following interface: The order status push interface is a POST request, and the fixed parameters in the request Body are as follows:
name | Required | Description |
---|---|---|
assetid | true | Equipment unique identification |
imsi | true | Multiple IMSI are separated by commas |
operation | true | The type of order action(see diagram below) |
orderid | true | Order number |
time | true | Order creation time |
The operation & effects as follows:
operation | Notes | Start Conditions | Effects |
---|---|---|---|
1001 | Terminate the order early | The order should be started | Order closed before the expected time and services disabled |
1002 | Cancel the order | The order is created but not started | Order closed and resource released |
1003 | Pause the order | The order has been started | Order paused and services disabled |
1004 | Restart the order | The order paused | Order started and services available |
1005 | Non-OTA order enabled | Order created and not starded | Order started and services available |
1006 | |||
1007 | OTA order enabled | OTA order created & Location Report occured in the coverage country | Order started and services available |
1008 | The order expired | The order created and started | The order closed and services disabled |
1009 | Renewal order period | The order created and not expired | More cycles added on the order |
1010 | Reduce cycles | The order created and not expired | The order-cycles cut-down |
Responses #
{
"assetid": "89852420180910344720",
"imsi": "204046990912345",
"operation": "1001",
"orderid": "L201901290000000533",
"time": "2019-10-16 12:34:54"
}
SMS MT data push #
The actual delivery status of the SMS returned by the operator after receiving it.
parameter | Description | Is required | Types of |
---|---|---|---|
supplier_code | The supplier to which the profile belongs | true | String |
msg_id | A unique identifier for the SMS, generated by the service provider | true | String |
phone | msisdn | true | String |
iccid | iccid | true | String |
status_report | Operator callback status: equals 1 if delivery is successful, otherwise equals 2 | false | String |
status_report_msg | Operator callback message: DELIVRD,FAILED | false | String |
timestamp | The time the delivery status was returned by the operator. format is yyyy-MM-dd HH24:mm:ss(UTC+8) |
true | String |
Body parameters #
{
"supplier_code": "SP000040",
"msg_id": "18fc707863a0000a37157dd34e6ec630",
"phone": "61482271041",
"iccid": "8943108169998931684",
"status_report": "1",
"status_report_msg": "DELIVRD",
"timestamp": "2024-05-30 18:00:00"
}
Response #
{
"code": "0",
"message": "success"
}
parameter | Description | Is required | Types of |
---|---|---|---|
code | The status code returned. 0 indicates success, non-zero indicates failure | true | String |
message | Description of the error details | true | String |
SMS MO data push #
The actual delivery status of the SMS returned by the operator after receiving it.
parameter | Description | Is required | Types of |
---|---|---|---|
supplier_code | The supplier to which the profile belongs | true | String |
phone | msisdn | true | String |
iccid | iccid | true | String |
dest_address | Service short code | true | String |
sms_content | The content of the SMS sent by the MO | true | String |
timestamp | The timestamp when the SMS arrived at the server. format is yyyy-MM-dd HH24:mm:ss(UTC+8) |
true | String |
Body parameters #
{
"supplier_code": "SP000040",
"phone": "61482271041",
"iccid": "8943108169998931684",
"dest_address": "12345",
"sms_content": "",
"timestamp": "2024-05-30 17:00:00"
}
Response #
{
"code": "0",
"message": "success"
}
parameter | Description | Is required | Types of |
---|---|---|---|
code | The status code returned. 0 indicates success, non-zero indicates failure | required | String |
message | Description of the error details | required | String |
Query details on single SIM card flow CDRS #
GET /cmp-api/sims/{sim_id}/cdr
Description #
Version #
1.0
Application scenario #
If the SIM card ID is available, you can query the flow CDRS of a specific SIM card within a specified period.
Business rules: #
When you specify SIM card query, you can query one SIM card at a time. The historical data can be up to 180 days from the current date.
Necessary condition #
SDK API call mode #
PartnerClient client = new PartnerClient(accessKey,privateKey);
client.v1().cdr().simCdr(SimCdr.builder(1, "8965011909030066336").receivedStartTime("2022-11-16").receivedEndBy("2022-12-16").pageNo(1).pageSize(10).build());
client.v2().cdr().simCdr(SimCdr.builder(1, "8965011909030066336").receivedStartTime("2022-11-16").receivedEndBy("2022-12-16").pageNo(1).pageSize(10).build());
Query parameters #
Type | Name | Schema | Required | Description |
---|---|---|---|---|
Path | sim_id | string | true | An AssetId, such as 893107042131441209 |
Query | received_start_time | string | true | Reception start time,such as 2023-09-16 |
Query | received_end_by | string | true | Reception end time,such as 2023-09-18 |
Query | page_no | integer | true | The requested page information of the traffic package. If the value of this node is empty, it defaults to page 1. |
Query | page_size | integer | true | The number of traffic package information contained in each page. If the value of this node is empty, the default value is 20. |
Responses #
{
"code": "0000",
"data": {
"data": [
{
"data": 1,
"imsi": "232010879771943",
"mcc": "460",
"mnc": "00",
"msisdn": "43688877771943",
"network": "4G",
"plan_id": "LP14240410004345",
"session_ended_at": null,
"session_started_at": "2024-05-09 18:18:56",
"sim_id": "89430101523088119435"
},
{
"data": 2,
"imsi": "232010879771943",
"mcc": "460",
"mnc": "00",
"msisdn": "43688877771943",
"network": "4G",
"plan_id": "LP14240410004345",
"session_ended_at": null,
"session_started_at": "2024-05-08 16:51:39",
"sim_id": "89430101523088119435"
},
{
"data": 1303552,
"imsi": "232010879771943",
"mcc": "460",
"mnc": "00",
"msisdn": "43688877771943",
"network": "4G",
"plan_id": "LP14240410004345",
"session_ended_at": null,
"session_started_at": "2024-05-08 16:49:59",
"sim_id": "89430101523088119435"
},
{
"data": 1303552,
"imsi": "232010879771943",
"mcc": "460",
"mnc": "00",
"msisdn": "43688877771943",
"network": "4G",
"plan_id": "LP14240410004345",
"session_ended_at": null,
"session_started_at": "2024-05-08 16:49:59",
"sim_id": "89430101523088119435"
}
],
"status": {
"code": "CB-00-0000",
"detail": null,
"message": "Success"
},
"total_count": 4
},
"message": "success",
"success": true
}
Name | Description |
---|---|
data[1].mcc | Mobile Country Code |
data[1].mnc | Mobile Network Code |
data[1].data | The usage of traffic for each part after CDR statistics, measured in bytes. |
data[1].plan_id | Package ID, same as bundle id |
data[1].session_started_at | The starting time of each portion of traffic after CDR statistics. |
data[1].session_ended_at | The end time of each portion of traffic after CDR statistics, which may be null. |
data[1].duration | The time interval between session_started_at and session_ended_at, in seconds |
Query details on single SIM card voice CDRS #
GET /cmp-api/sims/{sim_id}/voiceCdr
Description #
Version #
1.0
Application scenario #
If the SIM card ID is available, you can query the voice CDRS of a specific SIM card within a specified period.
Business rules: #
When you specify SIM card query, you can query one SIM card at a time. The historical data can be up to 180 days from the current date.
Necessary condition #
SDK API call mode #
PartnerClient client = new PartnerClient(accessKey,privateKey);
client.v1().voiceCdr().simCdr(SimCdr.builder(1, "8965011909030066336").receivedStartTime("2022-11-16").receivedEndBy("2022-12-16").pageNo(1).pageSize(10).build());
client.v2().voiceCdr().simCdr(SimCdr.builder(1, "8965011909030066336").receivedStartTime("2022-11-16").receivedEndBy("2022-12-16").pageNo(1).pageSize(10).build());
Query parameters #
Type | Name | Schema | Required | Description |
---|---|---|---|---|
Path | sim_id | string | true | An AssetId, such as 8961026924500757014 |
Query | received_start_time | string | true | Reception start time,such as 2024-07-01 |
Query | received_end_by | string | true | Reception end time,such as 2024-09-30 |
Query | page_no | integer | true | The requested page information of the traffic package. If the value of this node is empty, it defaults to page 1. |
Query | page_size | integer | true | The number of traffic package information contained in each page. If the value of this node is empty, the default value is 20. |
Responses #
{
"code": "0000",
"data": {
"data": [
{
"imsi": "505026900167177",
"mcc": "China",
"mnc": "China Unicom",
"cdrTime": "2024-07-26 16:52:46",
"duration": "100",
"plan_id": "LP14240611004443",
"sim_id": "8961026924500757014"
},
{
"imsi": "505026900167177",
"mcc": "China",
"mnc": "China Unicom",
"cdrTime": "2024-07-26 16:52:19",
"duration": "100",
"plan_id": "LP14240611004443",
"sim_id": "8961026924500757014"
}
],
"status": {
"code": "CB-00-0000",
"detail": null,
"message": "Success"
},
"total_count": 2
},
"message": "success",
"success": true
}
Name | Description |
---|---|
data[1].mcc | Mobile Country Code |
data[1].mnc | Mobile Network Code |
data[1].cdrTime | This is the time when the CDR data arrived. |
data[1].duration | This is the call duration for each voice session, measured in seconds. |
data[1].plan_id | Package ID, same as bundle id |
Query the CDR by single simId and apn #
GET /cmp-api/sims/{sim_id}/cdr/apn
Description #
Version #
1.0
Application scenario #
If a particular AssetID and its associated APN are valid, you can query CDR data for the specified period based on the AssetID and its associated APN.
Business rules: #
When you specify SIM card and its associated APN query, you can query one SIM card at a time. The historical data can be up to 180 days from the current date.
Necessary condition #
SDK API call mode #
PartnerClient client = new PartnerClient(accessKey,privateKey);
client.v1().cdr().simCdr(SimCdr.builder(1,"8965011909030066336").apn("&&&internet&0&&3&3,&&&ca.ntt.com&0&&3&3").receivedStartTime("2022-11-16").receivedEndBy("2022-12-16").pageNo(1).pageSize(10).build());
Query parameters #
Type | Name | Schema | Required | Description |
---|---|---|---|---|
Path | sim_id | string | true | An AssetId, such as 893107042131441209 |
Query | apn | string | false | One or more APN strings connected by English commas, such as &&&internet&0&&3&3,&&&ca.ntt.com&0&&3&3 |
Query | received_start_time | string | true | Reception start time,such as 2023-09-16 |
Query | received_end_by | string | true | Reception end time,such as 2023-09-18 |
Query | page_no | integer | true | The requested page information of the traffic package. If the value of this node is empty, it defaults to page 1. |
Query | page_size | integer | true | The number of traffic package information contained in each page. If the value of this node is empty, the default value is 20. |
Responses #
{
"code": "0000",
"data": {
"data": [
{
"data": 1,
"imsi": "232010879771943",
"mcc": "460",
"mnc": "00",
"msisdn": "43688877771943",
"network": "4G",
"plan_id": "LP14240410004345",
"session_ended_at": null,
"session_started_at": "2024-04-11 14:16:40",
"sim_id": "89430101523088119435",
"apn": null,
"duration": null
},
{
"data": 12288,
"imsi": "232010879771943",
"mcc": "460",
"mnc": "00",
"msisdn": "43688877771943",
"network": "4G",
"plan_id": "LP14240410004345",
"session_ended_at": null,
"session_started_at": "2024-04-11 13:17:57",
"sim_id": "89430101523088119435",
"apn": null,
"duration": null
},
{
"data": 8929280,
"imsi": "232010879771943",
"mcc": "460",
"mnc": "00",
"msisdn": "43688877771943",
"network": "4G",
"plan_id": "LP14240410004345",
"session_ended_at": null,
"session_started_at": "2024-04-11 11:50:25",
"sim_id": "89430101523088119435",
"apn": null,
"duration": null
}
],
"status": {
"code": "CB-00-0000",
"detail": null,
"message": "Success"
},
"total_count": 3
},
"message": "success",
"success": true
}
Name | Description |
---|---|
data[1].mcc | Mobile Country Code |
data[1].mnc | Mobile Network Code |
data[1].data | The usage of traffic for each part after CDR statistics, measured in bytes. |
data[1].plan_id | Package ID, same as bundle id |
data[1].session_started_at | The starting time of each portion of traffic after CDR statistics. |
data[1].session_ended_at | The end time of each portion of traffic after CDR statistics, which may be null. |
data[1].duration | The time interval between session_started_at and session_ended_at, in seconds |
Synchronized traffic package #
POST /cmp-api/package/syncPackages
Body parameters #
Considering that there may be many traffic packages used by this access party, each time synchronization is performed, a paging method is used, and only one page of traffic package information is synchronized to the access party each time, and the number of traffic package information contained in each page Defined by the access party. If the access party wants to get all the traffic package information and there are multiple pages of package information, the access party needs to call the synchronous traffic package interface multiple times.The information is defined as follows:
{
"page_no": 1,
"page_size": 2,
"version": 1.0
}
Name | Schema | Required | Description |
---|---|---|---|
page_no | integer | true | The requested page information of the traffic package. If the value of this node is empty, it defaults to page 1. |
page_size | integer | true | The number of traffic package information contained in each page. If the value of this node is empty, the default value is 20. |
version | string | false | The version of traffic package information. |
Responses #
Normal data:
{
"code": "0000",
"data": {
"page": {
"cur_page_no": 1,
"page_size": 2,
"total_count": 87,
"total_pages": 44
},
"sign": "mtu8eRc2AaBhBvG8ZJkIT1kKY0w=",
"package_num": 87,
"package": [
{
"flow": "1000",
"status": "1",
"serviceCycleCount": "1",
"buy_type": "2",
"cover_country_mcc": "404;405;406",
"cover_countrys": "India",
"max_order_period": "-1",
"min_order_period": "1",
"package_code": "DP20181122000201",
"package_desc": "",
"package_name": "testPackageForTATA",
"package_type": "2",
"package_usage_attribute": "1",
"price_type": "",
"whole_price": "",
"package_imsi_type": "2"
},
{
"flow": "100",
"status": "1",
"serviceCycleCount": "1",
"buy_type": "2",
"cover_country_mcc": "460;461",
"cover_countrys": "China",
"max_order_period": "-1",
"min_order_period": "1",
"package_code": "DP20190924001683",
"package_desc": "",
"package_name": "CN-100MB-Speed-Down-256K-Daily",
"package_type": "1",
"package_usage_attribute": "1",
"price_type": "",
"whole_price": "",
"package_imsi_type": "2"
}
]
},
"message": "success",
"success": true
}
In addition to the code and message nodes, it also contains the business parameter section (that is, the data node), which is defined as follows:
Name | Description |
---|---|
package_num | Number of traffic packages; If ret_info = 0000, the node information exists, |
package | Each package node contains a traffic package information; The number of package nodes in the response message must be the same as the value of package_num.If ret_info = 0000, the node information exists; |
page | The pagination information of the traffic package, so that the access system can determine whether all traffic packages have been obtained. If ret_info = 0000, the node information exists |
- The page node is defined as follows:
Name | Description |
---|---|
total_pages | total pages |
cur_page_no | Current page number |
total_count | Total number of traffic packages |
page_size | Number of traffic packages included per page |
- The package node is defined as follows:
Name | Description |
---|---|
package_type | Package product types.The values are defined as follows: 1-day traffic package; 2-month data plan; 3-quarter traffic package; 4-half year traffic package; 5-year traffic package; |
package_code | Package Product Code |
Package_name | Package Product Name |
package_desc | Package Product Description |
cover_country_mcc | The package covers the country code, and different country codes are separated by English semicolons; |
cover_countrys | The package covers country names, and different names are separated by semicolons in English; |
price_type | If the package type is 0, this field must have a value, which can include two types: 1- single-day pricing; 2-package pricing; |
flow | Package product traffic, unit is MB; If packageType is not 0, this field cannot be empty; |
buy_type | The ordering method of the data package products is defined as follows: 1- prepaid; 2-post payment; If packageType is not 0, this field cannot be empty; |
min_order_period | Package product minimum order period; |
max_order_period | The maximum order period for package products. If there is no maximum order period limit, fill in -1 here; |
whole_price | price |
status | 1: available, 2: obsolete |
package_usage_attribute | 1 resident package, 2 temporary package |
Bulk Order Package #
The access party can call this interface, and the access party can order packages in bulk for the devices it owns. The ordering rules are as follows:
-
Through this interface, you can order data packages in batches or schedule packages in batches.
-
If you order a data plan and you also need to activate the plan immediately, the newly ordered plan will be
activated immediately. The secondary data plan ordered by the ota device does not support the immediate activation operation.
-
If the data package is not ordered immediately, the iot system will not activate the package.
-
For sheb traffic package orders ordered for equipment in the inventory period, if support for test traffic is required, it will be processed as the first order.
POST /cmp-api/package/batchOrderPackages
Body parameters #
{
"deviceList": [
"89852022018041800192",
"89852022018041800193"
],
"global_order": "0",
"is_open": "0",
"order_period": "1",
"package_code": "DP20190726001274",
"package_name": "CN-UnSpeed-Limit-20M-Monthly",
"package_type": "2",
"pay_amount": "0",
"pay_rst": "2",
"pay_type": "1",
"test_flow": "0",
"test_flow_flag": "0"
}
Name | Schema | Required | Description |
---|---|---|---|
deviceList | list | true | Device identification node |
global_order | string | true | Whether the package ordered for the main number: 1-Yes 0-No |
package_name | string | true | Traffic Package Name |
package_code | string | true | Traffic Package Code |
package_type | string | true | Package product types.The values are defined as follows: 1-day traffic package; 2-month data plan; 3-quarter traffic package; 4-half year traffic package; 5-year traffic package; |
order_period | string | true | Order cycle |
pay_rst | string | true | The payment result is as follows: 1-unpaid; 2- payment is successful; |
pay_type | string | true | The payment method is as follows: 0-ipay88 1- WeChat 2- Alipay |
pay_amount | string | true | The payment amount for this order, in yuan, supports two digits after the decimal point; |
is_open | string | true | Whether to open this package immediately. For successful payment, allow it immediately; For unpaid orders, opening is not allowed, so be sure to judge the opening sign. Schedule package orders are not allowed to open; the secondary data package of ota equipment is not allowed to open immediately The values are as follows: 1-Open immediately; 0-disabled; |
test_flow_flag | string | 1 Yes 0 No, only the first order can be set to 1 | Is there test traffic |
test_flow | string | When test_flow_flag is 1, this field cannot be empty | Test traffic size |
- The deviceList node is defined as follows:
Name | Schema | Required | Description |
---|---|---|---|
device_id | String | true | Device identification |
Responses #
{
"code": "0000",
"data": {
"device_order": [
{
"error": "0000",
"errorMsg": "success",
"order_id": "ORDER_47454030993031168",
"device_id": "89852022018041800192",
"order_start_date": null,
"order_expire_date": null
},
{
"error": "0000",
"errorMsg": "success",
"order_id": "ORDER_47453927590854656",
"device_id": "89852022018041800193",
"order_start_date": null,
"order_expire_date": null
}
]
},
"message": "success",
"success": true
}
Except for the code and message nodes, the business parameter part (that is, the data node) is specifically defined as follows:
Name | Description |
---|---|
Device_order | Each deviceResp node contains a batch ordering information; |
- The Device_order node is defined as follows
Name | Description |
---|---|
order_id | The order id of the package. When the order is successful, that is, when red_code = 0000, change the field to take care |
order_start_date | Package activation time, the format is:YYYYMMDD This field exists when requested to activate this package immediately when requested; |
order_expire_date | The package is expected to expire in the format: YYYYMMDD This field exists when requested to activate this package immediately when requested; |
Error | Response result |
ErrorMsg | Response message |
Device_id | Equipment Identity |
Order An Extra Package #
Order a supplementary data package
POST /cmp-api/package/orderExtraPackage
Body parameters #
{
"device_id": "8949120240828080074",
"original_order_id": "ORDER_1856643184021573632",
"order_period": "1",
"package_code": "LP14241118004040",
"package_name": "iij-7Day-512M-Refueling package",
"package_type": "1"
}
Name | Schema | Required | Description |
---|---|---|---|
device_id | string | true | An Device identification node |
original_order_id | string | true | An order_id of basic data package |
package_name | string | true | An supplementary data package name |
package_code | string | true | An supplementary data package code |
package_type | string | true | Package product types.The values are defined as follows: 1-day traffic package; 2-month data plan; 3-quarter traffic package; 4-half year traffic package; 5-year traffic package; |
order_period | string | true | Order cycle |
Responses #
{
"code": "0000",
"data": true,
"message": "success",
"success": true
}
Query package order #
The access party can call this interface to query the equipment package order information of a certain enterprise. The query conditions are: order type (schedule package order, traffic package order), order status, order code, equipment type, equipment identification;
POST /cmp-api/package/queryOrder
Body parameters #
{
"device_id":null,
"order_id":null,
"order_status":null,
"page_no":1,
"page_size":3
}
Name | Schema | Required | Description |
---|---|---|---|
device_id | string | Device identification, the background performs fuzzy query according to the device identification | |
order_id | string | Order code. If the value is not empty, the query is performed in the background. | |
order_status | string | Order Status: 1- not enabled; 2- get started; 3- has ended or canceled; 5- suspended; |
|
page_no | Integer | true | The requested page of the traffic package order information. If the value of this node is empty, it defaults to page 1. |
page_size | Integer | true | The number of traffic package orders included on each page.If the value of this node is empty, the default is 20,the maximum value is 100. |
Response #
{
"code": "0000",
"data": {
"page": {
"cur_page_no": 1,
"page_size": 3,
"total_count": 191,
"total_pages": 64
},
"sign": "WJItqR1f5bXvHC2jyvysnS24MfI=",
"package_order": [
{
"buyType": "2",
"expireDate": "",
"flow": "10",
"orderCode": "ORDER_1595320587633311744",
"orderStatus": "1",
"orderDate": "20221123153722",
"orderPeriod": "30",
"packageCode": "DP20210322004206",
"packageName": "10M-unlimited-speed-2years",
"packageType": null,
"usedFlow": "0",
"flowUseRate": null,
"orderUsedFlow": "0",
"supplierCode": null,
"refuelingPackageList": [],
"hasTestFlow": "0",
"profileList": null,
"isFlowPlus": null,
"deviceId": "89852202110293091394",
"device_id": "89852202110293091394",
"activeDate": "",
"main_iccid": null
}
],
"package_order_num": 1
},
"message": "success",
"success": true
}
In addition to the code and message nodes, it also contains the business node part (that is, the data node), as defined below:
Name | Description |
---|---|
package_order_num | The number of traffic package orders;If ret_info = 0000, the node information exists, |
package_order | Each package_order node contains a traffic package order information; The number of package_order nodes in the response message must be the same as the value of package_order_num . If ret_info = 0000, the node information exists; |
page | Pagination information for traffic package orders, so that the access system can determine whether all traffic package orders have been obtained. If ret_info = 0000, the node information exists |
- The page node is defined as follows:
Name | Description |
---|---|
total_pages | total pages |
cur_page_no | Current page number |
total_count | Total traffic package orders |
page_size | Number of traffic package orders included per page |
- The package_order node is defined as follows:
parameter | Description | Is required | Types of |
---|---|---|---|
order_code | Package order code | required | String |
device_id | Device identification code | required | String |
package_name | Traffic package name | required | String |
package_code | Traffic Package Code | required | String |
package_type | 1-day traffic package;2-month data plan;3-quarter traffic package;4-half year traffic package;5-year traffic package; | required | String |
order_status | Order Status: 1- not enabled; 2- get started; 3- has ended or canceled; 5- suspended; |
required | |
buy_type | Schedule package, this node is empty, purchase method:1- Prepaid Package: Refueling packages are allowed, the order period is fixed, and renewal is not allowed;2-Post-paid package: Refueling packages are not allowed, but you can order iteratively, for example: if it is a month, the selected subscription period can be n months. Renewal is allowed. | Optional | String |
order_period | Subscription cycle of the package; | required | |
flow | Package traffic, unit: m bytes; schedule package, this node can be empty; | Optional | |
used_flow | The package uses traffic, which is defined as follows: If the package is a pre-paidpackage, it is the currently used traffic, the unit is kb; If the package is a postpaidpackage, it is the cumulative traffic used in the current subscription cycle unit. For example, if the package is a monthly package, it is the traffic used in the current month; if the package is a quarterly package, it is the traffic used in the current quarter; The value of this node in theschedule package is empty; Unit is kb | Optional | String |
flow_use_rate | Traffic usage, the values are: used_flow / flow, as a percentage; The value of this node in the schedule package is empty; | Optional | String |
order_used_flow | The order uses a total of total traffic; the unit is kb; the value of this node for the schedule package is empty; | Optional | String |
order_date | Package order date, format is:YYYYMMDDhhmiss | required | |
active_date | Package activation date in the format: yyyymmdd This field is blank if the package has not been activated | required | |
expire_date | Package Expiry Date, format is:YYYYMMDD | required | |
Whether the equipment is ordered with a fuel pack, the values are as follows:0- no refueling package ordered;1- order the refueling package;当 buy_type=1 时,即设备当前订购的是 预付费流量套餐,此字段存在,其他情况,不存在; | Optional | ||
refueling_package_list | Refueling package information exists when is_order_ refueling_package = 1. | Optional | Xml |
- The information contained in the refueling_package node is defined as follows:
parameter | Description | Is required | Types of |
---|---|---|---|
ref_orderId | Refueling Kit Order Code | required | String |
refpackage_flow | Fuel package flow, unit: m bytes | required | |
refpackage_order_date | Order date, format: YYYY-MM-DD hh: mi: ss | required | |
refpackage_status | Refueling bag status, the values are as follows: 1: Not enabled; 2: Start to use; 3: Used up; 4: Canceled | required | String |
Open data plan #
The access party can call the interface to open the data package that was previously ordered.
POST /cmp-api/package/openPackage
Body parameters #
{
"order_id": "202107061625560742397"
}
parameter | Description | Is required | Types of |
---|---|---|---|
order_id | When ordering a data plan, the id of the data plan returned by the iot system; | required | String |
Response #
{
"code": "0000",
"data": {
"sign": "ZFfUancP56BywWwPu8BKlJFJOyo=",
"order_id": "202107061625560742397",
"order_start_date": "2022-01-27 11:23:43",
"order_expire_date": "2023-11-27 23:59:59"
},
"message": "success",
"success": true
}
In addition to the code and message nodes, it also contains the business node part (that is, the data node), as defined below:
parameter | Description | Is required | Types of |
---|---|---|---|
order_id | Subscription id of the data plan; When the activation is successful, that is, when ret_code = 0000, this field exists. | required | String |
order_start _date | Data package activation time, the format is:YYYYMMDD;When the activation is successful, that is, when ret_code = 0000, this field exists. | Optional | String |
order_expi re_date | Data package is expected to expire in the format:YYYYMMDD;When the activation is successful, that is, when ret_code = 0000, this field exists. | Optional | String |
Renew the specified order #
Add renewal periods to the existing order,renewal is only allowed for orders that are inactive, active or suspended.
POST /cmp-api/package/renewPackage
Body parameters #
{
"order_id": "ORDER_1856163024282284032",
"renew_period": 1
}
parameter | Description | Is required | Types of |
---|---|---|---|
order_id | The order_id of the specified order. | required | String |
renew_period | The number of renewal periods. | required | Integer |
Response #
In addition to the code and message nodes, it also contains the business node part (that is, the data node). Example response message:
{
"code": "0000",
"data": {
"order_expire_date": "2024-11-23 23:59:59",
"order_id": "ORDER_1856163024282284032"
},
"message": "success",
"success": true
}
Cancel package order #
An access party can call this interface to cancel a previously ordered order. The prerequisite for cancellation is that the order has not been activated or has not been paid.
POST /cmp-api/package/cancelPackage
Body parameters #
{
"order_id": "202108011627816741391"
}
parameter | Description | Is required | Types of |
---|---|---|---|
order_id | When ordering a package, the iot system returns the package order id | required | String |
Response #
In addition to the code and message nodes, it also contains the business node part (that is, the data node). Example response message:
{
"code": "0000",
"data": null,
"message": "Success",
"success": true
}
End package orders early #
The access party can call the interface to end the subscription package in advance. The condition for early termination is that the order is enabled.
POST /cmp-api/package/aheadFinishDeviceOrder
Body parameters #
{
"ahead_finish_cause": "test",
"device_type": "",
"order_id": "202107061625560742397"
}
parameter | Description | Is required | Types of |
---|---|---|---|
device_type | Device type: 1-mifi; 2-module; 3- tour card; 4-IoT card; 5-soc | Optional | String |
order_id | Order number to close early | required | String |
ahead_finish_cause | Order end reason | required | String |
Response #
{
"code": "0000",
"data": null,
"message": "Success",
"success": true
}
Send SMS message #
POST /cmp-api/sms/sendSms
parameter | Description | Is required | Types of |
---|---|---|---|
flag_list | A collection of multiple device_id and msg_id | required | String |
sms_content | The content to be sent | required | String |
message_type | 1: text type, 2: binary type | required | String |
The flag_list node is defined as follows:
parameter | Description | Is required | Types of |
---|---|---|---|
msg_id | The msg_id carried when sending the SMS,which is starting with ‘LK’ and up to 32 characters in length |
required | String |
device_id | One or more device_id strings connected by commas | required | String |
Body parameters #
{
"flag_list": [
{
"device_id": "89430101523088119436",
"msg_id": "LK20240509120100000002"
}
,
{
"device_id": "89430101523088119435",
"msg_id": "LK20240509120100000001"
}
],
"sms_content": "The content of the MT SMS",
"message_type": "1"
}
Response #
{
"code": "0000",
"data": null,
"message": "Success",
"success": true
}
Query MT SMS Record #
POST /cmp-api/sms/queryMTSmsStatus
parameter | Description | Is required | Types of |
---|---|---|---|
device_id | One device_id string | false | String |
msg_id | The same as the msg_id parameter used when calling sendSMS | false | String |
page_no | Integer | false | The requested page of the sms information. If the value of this node is empty, it defaults to page 1. |
page_size | Integer | false | The number of sms included on each page.If the value of this node is empty, the default is 20,the maximum value is 100. |
Body parameters #
{
"device_id": "8961026924500530494",
"msg_id": "LK20240531155200000001",
"page_no": 1,
"page_size": 10
}
Response #
{
"code": "0000",
"data": {
"data": [
{
"assetId": "8961026924500530494",
"msisdn": "61482271041",
"sendStartTime": "2024-05-31 15:52:34",
"sendStatus": "1",
"statusReport": "1",
"sendEndTime": "2024-05-31 15:52:38"
}
],
"status": {
"code": "CB-00-0000",
"detail": null,
"message": "Success"
},
"total_count": 1
},
"message": "success",
"success": true
}
- The data node is defined as follows:
parameter | Description | Is required | Types of |
---|---|---|---|
assetId | device Id | true | String |
msisdn | msisdn | false | String |
sendStartTime | The time when the text message was sent(UTC+8) | true | String |
sendEndTime | The callback time after the SMS is successfully sent(UTC+8) | false | String |
sendStatus | Whether the SMS has been sent,1:was sent,2:was not sent | true | String |
statusReport | The result of the SMS callback,1:DELIVRD,2:FAILED | false | String |
Query MO、MT CDR #
POST /cmp-api/sms/querySmsCDR
parameter | Description | Is required | Types of |
---|---|---|---|
device_id | One device_id string | true | String |
page_no | Integer | false | The requested page of the sms information. If the value of this node is empty, it defaults to page 1. |
page_size | Integer | false | The number of sms included on each page.If the value of this node is empty, the default is 20,the maximum value is 100. |
begin_time | The format is yyyy-MM-dd(UTC+8) | false | String |
end_time | The format is yyyy-MM-dd(UTC+8) | false | String |
Body parameters #
{
"device_id": "89430101523088119435",
"begin_time": "2024-06-03",
"end_time": "2024-06-04",
"page_no": 1,
"page_size":3
}
Response #
{
"code": "0000",
"data": {
"totalData": 242,
"count": 5,
"totalPage": 49,
"data": [
{
"deviceId": "8961026924500530510",
"fromIccid": null,
"toIccid": "8961026924500530510",
"sendMsisdn": null,
"recMsisdn": "61482271050",
"smsType": "MT",
"timestamp": "2024-07-12 16:04:42",
"sendStatus": ""
},
{
"deviceId": "8961026924500530510",
"fromIccid": null,
"toIccid": "8961026924500530510",
"sendMsisdn": null,
"recMsisdn": "61482271050",
"smsType": "MT",
"timestamp": "2024-07-12 16:07:10",
"sendStatus": ""
}
]
},
"message": "success",
"success": true
}
- The data node is defined as follows:
parameter | Description | Is required | Types of |
---|---|---|---|
deviceId | true | String | |
fromIccid | iccid for MO | false | String |
toIccid | iccid for MT | false | String |
sendMsisdn | user phone for MO | false | String |
recMsisdn | user phone for MT | false | String |
smsType | Value list: MO MT |
false | String |
timestamp | MT:the time of send data(UTC+8) MO:the time of receive mo content(UTC+8) |
false | String |
sendStatus | Delivery Report for MT,value list: 1:Success 2:Failure |
false | String |
Query the latest SMS CDR #
POST /cmp-api/sms/queryLatestCDR
parameter | Description | Is required | Types of |
---|---|---|---|
imsi | The IMSI of the CDR to be queried | required | String |
Body parameters #
{
"imsi": "525016126013486"
}
Response #
{
"code": "0000",
"data": {
"returnCode": "1",
"smsMt": {
"smsErrorCount": "0",
"count": "0"
},
"gprs": {
"tx": "0.0",
"pdpActive": "false",
"rx": "0.0"
},
"imsi": "525016126013486",
"msisdn": "65144095005251",
"smsMo": {
"smsErrorCount": "0",
"count": "0"
},
"customerNo": null
},
"message": "success",
"success": true
}
- The data node is defined as follows:
Name | Description |
---|---|
returnCode | The status of the session is as follows: 0: OK 1: Resource not available 2: Error in service 3: Internal error 4: Resource not visible |
imsi | Optional. The IMSI according to E.212. |
msisdn | Optional. The MSISDN according to E.164. |
imei | Optional. 15–16 digit IMEI or IMEISV. |
sessionStart | Optional. Timestamp for the start of the 3G or LTE session. A session contains all real-time data and counters for a specific IMSI. |
lastActivity | Optional. Timestamp for the last event received for the session It is updated for all events. |
lastSmsError | Optional. Last error description. |
customerNo | A string containing the customer number of the related A string containing the customer number of the related. |
lastLu | Optional. Last Location Update. |
lastSmsErrorTime | Optional. |
smsMt | Optional. Further details are shown in Table 1. |
smsMo | Optional. Further details are shown in Table 2. |
gprs | Optional. Further details are shown in Table 3. |
The SMS MT contains the elements shown in Table 1
- Table 1 SMS MT
parameter | Description | Is required | Types of |
---|---|---|---|
count | Optional. The number of mobile terminated SMSes. | no | String |
lastSms | Optional. The time stamp of the last mobile terminated SMS. | no | String |
smsErrorCount | Optional. Error count. | no | String |
The SMS MO contains the elements shown in Table 2
- Table 2 SMS MO
parameter | Description | Is required | Types of |
---|---|---|---|
count | Optional. The number of mobile originated SMSes. | no | String |
lastDest | Optional. The MSISDN the last SMS was sent to. | no | String |
lastSms | Optional. The time stamp of the last mobile originated SMS. | no | String |
smsErrorCount | Optional. Error count. | no | String |
The GPRS contains the elements shown in Table 3
- Table 3 GPRS
parameter | Description | Is required | Types of |
---|---|---|---|
pdpActive | Optional. Indicates if the PDP is active. The possible values are: true false |
no | String |
activation | Optional. The timestamp of the PDP activation. | no | String |
ip | Optional. IPv4 address of the SIM in the mobile network. | no | String |
tx | Optional. Transmitted bytes in double-precision floating-point format according to the IEEE Standard for Floating-Point Arithmetic. See IEEE 754-2008, Reference [11] for more information. The decimal separator is always a period (.), no thousands separator is used. Valid values include: 123.456 +1234.456 -1.2344e56 -.45E-6 INF -INF NaN |
no | String |
lastTx | Optional. The timestamp of the last transmitted data. | no | String |
rx | Optional. Transmitted bytes in double-precision floating-point format according to the IEEE Standard for Floating-Point Arithmetic. See IEEE 754-2008, Reference [11] for more information. The decimal separator is always a period (.), no thousands separator is used. Valid values include: 123.456 +1234.456 -1.2344e56 -.45E-6 INF -INF NaN |
no | String |
lastRx | Optional. The timestamp of the last received data. | no | String |
giDestAddress | Optional. IPv4 address of the SIM on the Internet. | no | String |
Restart a suspended order #
POST /cmp-api/device/restartService
parameter | Description | Is required | Types of |
---|---|---|---|
device_id | Device Id | Optional | String |
order_id | Order number | required | String |
Body parameters #
{
"device_id": "device_id_b1b04b45e20c",
"order_id": "order_id_121270d9e485"
}
Response #
{
"code": "0000",
"data": null,
"message": "Success",
"success": true
}
Query device information #
Query device information based on the device ID, including lifecycle data and data related to active or paused orders.
POST /cmp-api/device/queryDevice
Body parameters #
{
"device_id": "89852202310161621656",
"timestamp": "1606268400095"
}
Name | Schema | Required | Description |
---|---|---|---|
device_id | string | Device identification code | |
timestamp | string | Current time in milliseconds based on UTC time. |
Response #
{
"code": "0000",
"data": {
"device_id": "89852202310161621656",
"ota_flag": "2",
"bip_flag": "2",
"multiImsi_flag": "0",
"lifecycle": "2",
"lifecycle_start_time": "20231124",
"lifecycle_end_time": "20240531",
"lifecycle_slient_period": "6",
"lifecycle_shutdown_period": "2",
"package_order": {
"orderCode": "ORDER_1727992973356523520",
"packageName": "JP-UnLimited-Speed-30GB-Monthly",
"packageCode": "LP14231124004197",
"packageType": "2",
"buyType": "2",
"orderPeriod": "6",
"flow": "30720",
"usedFlow": "0",
"flowUseRate": "0.00%",
"orderUsedFlow": "19397607",
"orderDate": "2023-11-24 18:10:04",
"activeDate": "20231124",
"expireDate": "20240531",
"orderStatus": "2",
"profileList": [
{
"iccid": "89852202310161621656",
"imsi": "440039980621656",
"msisdn": "FFFFFFFFFF"
}
]
}
},
"message": "success",
"success": true
}
- The page node is defined as follows:
Name | Description |
---|---|
device_id | Device identification code |
ota_flag | OTA feature flag: 1 - Has OTA functionality, 2 - Does not have OTA functionality. |
bip_flag | BIP feature flag: 1 - Has BIP functionality, 2 - Does not have BIP functionality. |
multiImsi_flag | Multiple IMSI feature flag : 1 - is a multi-IMSI device. 0 - is not a multi-IMSI device. |
lifecycle | The current lifecycle stage of the device: 0 - Inventory period; 1 - Silent period; 2 - Usage period; 3 - Suspended service period; 4 - Disposal and recycling period; 5 - Internal inventory period. |
lifecycle_start_time | Start date of the current lifecycle. |
lifecycle_end_time | End date of the current lifecycle. |
lifecycle_slient_period | The length of the silent period, typically 6 months. |
lifecycle_shutdown_period | The length of the suspended service period, typically 2 months. |
package_order | Each package_order node contains a traffic package order information(Only includes activated orders) |
- The package_order node is defined as follows:
parameter | Description | Is required | Types of |
---|---|---|---|
order_code | Package order code | required | String |
device_id | Device identification code | required | String |
package_name | Traffic package name | required | String |
package_code | Traffic Package Code | required | String |
package_type | 1-day traffic package;2-month data plan;3-quarter traffic package;4-half year traffic package;5-year traffic package; | required | String |
order_status | Order Status: 1- not enabled; 2- get started; 3- has ended or canceled; 5- suspended; |
required | |
buy_type | Schedule package, this node is empty, purchase method:1- Prepaid Package: Refueling packages are allowed, the order period is fixed, and renewal is not allowed;2-Post-paid package: Refueling packages are not allowed, but you can order iteratively, for example: if it is a month, the selected subscription period can be n months. Renewal is allowed. | Optional | String |
order_period | Subscription cycle of the package; | required | |
flow | Package traffic, unit: m bytes; schedule package, this node can be empty; | Optional | |
used_flow | The package uses traffic, which is defined as follows: If the package is a pre-paidpackage, it is the currently used traffic, the unit is kb; If the package is a postpaidpackage, it is the cumulative traffic used in the current subscription cycle unit. For example, if the package is a monthly package, it is the traffic used in the current month; if the package is a quarterly package, it is the traffic used in the current quarter; The value of this node in theschedule package is empty; Unit is kb | Optional | String |
flow_use_rate | Traffic usage, the values are: used_flow / flow, as a percentage; The value of this node in the schedule package is empty; | Optional | String |
order_used_flow | The order uses a total of total traffic; the unit is kb; the value of this node for the schedule package is empty; | Optional | String |
order_date | Package order date, format is:YYYYMMDDhhmiss | required | |
active_date | Package activation date in the format: yyyymmdd This field is blank if the package has not been activated | required | |
expire_date | Package Expiry Date, format is:YYYYMMDD | required |
- The profileList node is defined as follows:
parameter | Description | Is required | Types of |
---|---|---|---|
iccid | The iccid associated with the order. | required | String |
imsi | The imsi associated with the order. | required | String |
msisdn | The msisdn associated with the order. | required | String |
Suspend an active order #
POST /cmp-api/device/pauseService
parameter | Description | Is required | Types of |
---|---|---|---|
device_id | Device Id | Optional | String |
order_id | Order number | required | String |
Body parameters #
{
"device_id": "device_id_b1b04b45e20c",
"order_id": "order_id_121270d9e485"
}
Response #
{
"code": "0000",
"data": null,
"message": "Success",
"success": true
}
Batch query device information #
POST /cmp-api/device/queryBatchDevice
parameter | Description | Is required | Types of |
---|---|---|---|
page_no | The requested page information of the traffic package. If the value of this node is empty, it defaults to page 1. | Optional | Integer |
page_size | The number of traffic package information contained in each page. If the value of this node is empty, the default value is 20. | Optional | Integer |
Body parameters #
{
"page_no": 91,
"page_size": 2
}
Response #
{
"code": "0000",
"data": {
"device": [
{
"partnerName": null,
"partnerCode": "CN00000581",
"lifecycle": "2",
"msisdn": null,
"device_id": "8961026924500530387",
"ota_flag": "2",
"bip_flag": "2",
"lifecycle_start_time": "20240717",
"lifecycle_end_time": "20540731",
"lifecycle_shutdown_period": "12",
"lifecycle_slient_period": "6",
"task_no": null,
"main_iccid": null,
"multiImsi_flag": "0",
"package_order": {
"imsi": "505026900144514",
"msisdn": "61482271037",
"buyType": "2",
"expireDate": "20540731",
"flow": "0",
"orderCode": "ORDER_1813405637569282048",
"orderStatus": "2",
"orderDate": "2024-07-17 10:49:30",
"orderPeriod": "360",
"packageCode": "LP14240611004444",
"packageName": "AUS-Unlimited-Speed-3APNs-10GB-Monthly",
"packageType": "2",
"usedFlow": "0",
"flowUseRate": "0.00%",
"orderUsedFlow": "0",
"supplierCode": "SP000040",
"refuelingPackageList": [],
"hasTestFlow": null,
"profileList": null,
"isFlowPlus": null,
"deviceId": "8961026924500530387",
"device_id": "8961026924500530387",
"activeDate": "20240717",
"main_iccid": "8961026924500530387"
}
}
],
"page": {
"cur_page_no": 91,
"page_size": 2,
"total_count": 183,
"total_pages": 92
},
"device_num": 2
},
"message": "success",
"success": true
}
Bind the device via IMEI (Beta) #
This interface is not available for all AssetId, please contact the administrator if you need it. #
POST /cmp-api/device/bind
name | Required | Description | Types of |
---|---|---|---|
device_id | true | Device identification code | String |
imei | true | 15–16 digit IMEI or IMEISV. | String |
oper_type | true | Type of operation 1- Device Binding IMEI 2- Device Unbinding IMEI |
String |
ota_flag | true | OTA Device Identification 1- OTA Device 2- No OTA Device |
String |
auto_bind_flag | true | The first time the network is automatically bind 1- YES 2- NO |
String |
Body parameters #
{
"device_id" : "8949120240814080070",
"imei": "860996043052016",
"oper_type" : "1",
"ota_flag": "2",
"auto_bind_flag" : "2"
}
Responses #
{
"code":"0000",
"data":"success",
"message":"success",
"success":true
}
Get Binding History (Beta) #
This interface is not available for all AssetId, please contact the administrator if you need it. #
POST /cmp-api/device/getBindTrackList
name | Required | Description | Types of |
---|---|---|---|
device_id | true | Device identification code | String |
Body parameters #
{
"device_id" : "8949120240814080070"
}
Responses #
{
"code": "0000",
"data": [
{
"iccid": "8949120240814080070",
"track": "Binding Device Card",
"imei": "860996043052016",
"operUser": null,
"createTime": "2024-08-20 10:37:52"
}
],
"message": "success",
"success": true
}
Get traffic threshold notification #
After providing the address to receive traffic threshold notifications to the administrator, when the card number traffic reaches a specific threshold, the following requests can be received at this address #
Name | Schema | Required | Description |
---|---|---|---|
device_id | true | String | Device identification code |
iccid | true | String | ICCID |
imsi | true | string | IMSI |
msisdn | true | string | MSISDN |
volume_threshold | true | string | Threshold |
supplier_code | true | string | Supplier Code |
volume_unit | true | string | Threshold Unit (B/KB/MB/GB)) |
warning_time | true | string | Event timestamp |
{
"device_id": "894301333345484703",
"iccid": "894301333345484703",
"imsi": "23201037438473490",
"msisdn": "436823321648",
"supplier_code": "SP000040",
"volume_threshold": "10",
"volume_unit": "MB",
"warning_time": "2024-12-30 14:45:42"
}