Get esim package list
URL
Request Method
- POST
Rate Limit
- 5 requests per second
Request Header
| Header Name | Optional | Value |
|---|---|---|
| content-type | yes | application/json |
| appId | yes | Your app ID |
| timestamp | yes | Current timestamp |
| sign | yes | HMAC-SHA256 signature |
Request Examples
curl --location 'http://sandbox-api.yoni-esim.com/v1/package/e-sim/page' \
--header 'appId: {{appId}}' \
--header 'timestamp: {{timestamp}}' \
--header 'sign: {{sign}}' \
--header 'Content-Type: application/json' \
--data '{
"current":1,
"size":10
}'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"current\":1,\r\n \"size\":10\r\n}");
Request request = new Request.Builder()
.url("http://sandbox-api.yoni-esim.com/v1/package/e-sim/page")
.method("POST", body)
.addHeader("appId", "{{appId}}")
.addHeader("timestamp", "{{timestamp}}")
.addHeader("sign", "{{sign}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var request = require('request');
var options = {
'method': 'POST',
'url': 'http://sandbox-api.yoni-esim.com/v1/package/e-sim/page',
'headers': {
'appId': '{{appId}}',
'timestamp': '{{timestamp}}',
'sign': '{{sign}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"current": 1,
"size": 10
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "http://sandbox-api.yoni-esim.com/v1/package/e-sim/page"
payload = json.dumps({
"current": 1,
"size": 10
})
headers = {
'appId': '{{appId}}',
'timestamp': '{{timestamp}}',
'sign': '{{sign}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Request Parameter
| Name | Optional | Type | Description |
|---|---|---|---|
| current | no | Number | Current page (greater than or equal to 1) |
| size | no | Number | Page size (between 1 and 50) |
Response Example
{
"code": 0,
"data": {
"records": [
{
"packageName": "Japan, 1 Day, 500M, 256kbps",
"packageCode": "YN2602130xxxxx",
"price": 0.50,
"simType": "1",
"packageType": "1",
"mcc": "440,441",
"country": "日本",
"countryEn": "Japan",
"flow": 500,
"apn": "mobile.demo.com",
"effectiveDays": 60,
"operator": "Docomo / Softbank / Rakuten Mobile / KDDI",
"days": "1",
"desc": "ESIM can be installed in advance, and upon arrival at the location, the package will be automatically activated and the SIM card's validity days will begin to be calculated."
},
{
"packageName": "Malaysia, 1 Day, 1GB, 256kbps",
"packageCode": "YN2602130xxxxx",
"price": 1.00,
"simType": "1",
"packageType": "2",
"mcc": "502",
"country": "马来西亚",
"countryEn": "Malaysia",
"flow": 1024,
"apn": "mobiledata",
"effectiveDays": 60,
"operator": "Maxis Berhad",
"days": "1",
"desc": "ESIM can be installed in advance, and upon arrival at the location, the package will be automatically activated and the SIM card's validity days will begin to be calculated."
}
],
"total": 2
},
"msg": "success"
}
Response Result
| Name | Type | Description |
|---|---|---|
| code | String | eSIM response code (error codes) |
| msg | String | Result description |
| data | Object | Object of packages. |
| data.total | Number | Total number of packages |
| data.records | Array | Array of packages. |
| records[0].packageName | String | Package name |
| records[0].packageCode | String | Unique identifier of the package. |
| records[0].price | Number | Price (in the contract currency). |
| records[0].simType | String | SIM type (currently, only 1 is supported, indicating eSIM). |
| records[0].packageType | String | Package type (1 = daily, 2 = multiple months). |
| records[0].mcc | String | Mobile Country Code (MCC). |
| records[0].country | String | Country name |
| records[0].countryEn | String | Country name in English |
| records[0].flow | Number | Package data allowance; 0 indicates unlimited data. Unit: MB |
| records[0].apn | String | Access Point Name (APN). |
| records[0].effectiveDays | Number | Validity period before eSIM activation (days). |
| records[0].operator | String | Carrier / mobile network operator |
| records[0].days | String | Package duration (days) |
| records[0].desc | String | Package description |
