Mp Apis

Overview #

Request ID (Only for MP API) #

Update September 25, 2023

Description #

Request
All MP API requests support log traces.
Add the parameter requestId to the Query params of the GET request or to the Body of the POST request to indicate the uniqueness of the request.
The call log generated by the interface will be automatically stored in the database for relevant personnel to query.
At the same time, the interface also can be used normally without the parameter requestId.However, the generated call log has no unique identifier and can only be filtered by call time.
Response
If you use requestId in your request, the same requestId will be included in the return response to your request. Otherwise, the requestId return value is null.

Specification for generating requestId #

A requestId can be a string of any format, up to 500 bytes in length, and must be unique to the caller.

For example:

This is a string of the current time and random numbers generated by the snowflake algorithm.

requestId: 202309251611-1683713932415610880

Note:
If the requestId parameter is added to the GET request, the requestId also participates in the signature calculation.

overview of the apis #

Path API Name
/mp-api/api/esim/queryOrderStatus Order status query
/mp-api/api/esim/queryTraffic Traffic query
/mp-api/api/esim/switchOrder Switch order
/mp-api/api/esim/saveAlarmCallbackInterface Specifies the callback interface
/mp-api/api/esim/packageList get package List
/mp-api/api/esim/activationCode get QR code and create order

Alarm callback #

Specifies the callback interface #

You need to write a request interface (It must be a POST interface) in your service, and then call /mp-api/api/esim/saveAlarmCallbackInterface to save the full URL of your interface into the Links Field configuration.

POST /mp-api/api/esim/saveAlarmCallbackInterface

Body parameters

Name Schema Required Description Default Example Fixed Value
resellerCode string true Reseller Code SG00000010 false
httpMethod string true HTTP Method POST POST true
httpUrl string true HTTP Full Url http://www.baidu.com/index.html false
requestId string false Request ID (For logging) 202309251611-1683713932415610880 false

Responses

{
    "code": 200,
    "msg": "Success",
    "data": "httpUrl",
    "requestId": null
}

Alarm callback #

When the usage reaches the specified threshold, callback push is triggered, and the alarm information is sent to the specified server by querying the callback interface configured with the Reseller.

Callback interface params

Name Schema Required Description
eid string true EID
packageCode string true Package Code
orderCode string true Order Code
packageUsedRate string true Package Used Rate
Example : "53% 84% 100%"
requestId string false Request ID (For logging)

Order status query #

GET /mp-api/api/esim/queryOrderStatus

Query parameters #

Type Name Schema Required Description
Query orderCode string true Order Code
Query requestId string false Request ID (For logging)

Responses #

Note: Multiple pieces of data may be returned

Normal Data:

{
  "code": 200,
  "msg": "Success",
  "data": [
    {
      "eid": "89491202308310000235",
      "packageCode": "LP14230831004073",
      "status": "0",
      "actualStartTime": null,
      "plannedEndTime": null
    }
  ],
  "requestId": null
}

Null data:

{
    "code": 200,
    "msg": "Success",
    "data": [{
        "eid": null,
        "packageCode": null,
        "status": null,
        "actualStartTime": null,
        "plannedEndTime": null
    }],
    "requestId": null
}
Name Description
eid eSIM`s EID
packageCode Package Code
status Order status (0- Not enabled; 1- In use; 2- Suspended; 3- Finished)
actualStartTime Actual start time
plannedEndTime Scheduled end time

Traffic query #

GET /mp-api/api/esim/queryTraffic

Query parameters #

Type Name Schema Required Description
Query orderCode string true Order Code
Query requestId string false Request ID (For logging)

Responses #

Note: Multiple pieces of data may be returned

Normal data:

{
  "code": 200,
  "msg": "Success",
  "data": [
    {
      "eid": null,
      "packageCode": "LP14230831004073",
      "packageFlow": null,
      "packageUsedFlow": null,
      "actualStartTime": null,
      "plannedEndTime": null,
      "cycle": "1"
    }
  ],
  "requestId": null
}

Null data:

{
    "code": 200,
    "msg": "Success",
    "data": [{
        "eid": null,
        "packageCode": null,
        "packageFlow": null,
        "packageUsedFlow": null,
        "actualStartTime": null,
        "plannedEndTime": null,
        "cycle": null
    }],
   "requestId": null
}
Name Description
eid eSIM`s EID
packageCode Package Code
packageFlow Total package traffic (MB)
packageUsedFlow Package used data (MB)
cycle Order period (Month)
actualStartTime Actual start time
plannedEndTime Scheduled end time

Switch order #

POST /mp-api/api/esim/switchOrder

Body parameters #

Name Schema Required Description
orderCode string true Order Code
switchButton string true Status switch
Example : "ON/SUSPEND/RESTART/OFF"
requestId string false Request ID (For logging)

Note:
OrderCode can determine an order separately

Update:
Update September 25, 2023
switchButton added pause and re-enable operations. Set the correct values based on the switchButton example value

Responses #

{
    "code": 200,
    "msg": "Success",
    "data": null,
    "requestId": null
}

Package List #

GET /mp-api/api/esim/packageList

Query parameters #

Type Name Schema Required Description
Query requestId string false Request ID (For logging)

Responses #

{
  "code": 200,
  "msg": "Success",
  "data": [
    {
      "packageCode": "LP14230423003990",
      "packageName": "C_M_000981_P_S_越南30天不限量不限速日套餐(弗兰威尔TB100)",
      "coverCountry": "452",
      "coverCountryName": "Vietnam"
    },
    {
      "packageCode": "LP14230423003990",
      "packageName": "C_M_000981_P_S_越南30天不限量不限速日套餐(弗兰威尔TB100)",
      "coverCountry": "452",
      "coverCountryName": "Vietnam"
    },
    {
      "packageCode": "LP14230423003991",
      "packageName": "C_M_000981_P_S_TB60越南6GB1天限速128kbps日套餐(弗兰威尔)",
      "coverCountry": "452",
      "coverCountryName": "Vietnam"
    },
    {
      "packageCode": "LP14230423003992",
      "packageName": "C_M_000981_P_S_TB100越南30天不限量不限速日套餐(弗兰威尔)",
      "coverCountry": "452",
      "coverCountryName": "Vietnam"
    },
    {
      "packageCode": "LP14230424003995",
      "packageName": "C_M_000981_P_S_TB100越南6GB1天限速128kbps日套餐(弗兰威尔)",
      "coverCountry": "452",
      "coverCountryName": "Vietnam"
    }
  ],
  "requestId": null
}

Activation Code #

POST /mp-api/api/esim/activationCode

Body parameters #

Name Schema Required Description
packageCode string true Package Code
activateFlag string false Activation order flag
Example : "yes/no"
requestId string false Request ID (For logging)

Note: activationCode is String of the QR which will be scanned by the end-user to download/instal the profile.

orderCode is an unique ID in the MP system. The access party should bind an unique ID in their own system to manage the relations later for the traffic query,service(disable/enable) etc.

Responses #

{
    "code": 200,
    "msg": "Success",
    "data": {
        "orderCode": "ORDER_1697180313207705600",
        "iccid": "8943108169999542001",
        "qrCode": "LPA:1$rsp-0001.linksfield.net$I8ZC9-JIPOM-XUZOP-X1FEO"
    },
    "requestId": null
}