Get SIM Usage
GET
/sims/{sim_id}/usageLast modified: 1 年前
Description
Query the daily or monthly service usage of SIM within a specified period.
Version
v1.0
Notes
category
:currently support: data.period_type
: daily/monthly- Daily: back track up to 60 days
- Monthly: back track up to 6 months including current month
- The CDRs may experience latency - the usage may change.
- Only usage after 2023-01-01 is available.
Example
- 1:Query daily usage of 10/1/22.
/sims/89852123456789012345/usage?category=data&period_type=1&begin_from=2022-10-01&end_by=2022-10-01
- 2:Query monthly usage form 10/22 to 11/22.
```js
/sims/89852123456789012345/usage?category=data&period_type=2&begin_from=2022-10&end_by=2022-11
```
请求参数
Path Params
sim_id
string
required
SIM ICCID
Example:
89852123456789012345
Query Params
category
string
required
support:data
Example:
data
period_type
string
required
1-daily,2-monthly,UTC 0
Example:
1
begin_from
string
required
When period_type=1,sample value: 2022-10-01. When period_type=2,sample value: 2022-10.
Example:
2022-10-01
end_by
string
required
When period_type=1,sample value: 2022-10-01. When period_type=2,sample value: 2022-10.
Example:
2022-10-01
示例代码
Responses
Success(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
Data Schema
data
object
required
sim_id
string
required
SIM card ICCID
usage
array [object {3}]
required
usage
status
object
required
code
string
required
message
string
required
detail
string | null
required
Example
{
"data": {
"sim_id": "89852123456789012345",
"usage": [
{
"period": "2022-10-10",
"updated_at": "2022-10-10 12:12:12",
"data": {
"all": "2222"
}
},
{
"period": "2022-10-9",
"updated_at": "2022-10-10 12:12:12",
"data": {
"all": "2222"
}
}
]
},
"status": {
"code": "CB-00-0000",
"message": "Success",
"detail": null
}
}
Last modified: 1 年前