更新时间:2024-09-11 GMT+08:00
分享

批量查询SIM卡日用量

功能介绍

批量查询SIM卡日用量接口,支持按天或按月查询。SIM卡标识和容器ID只能选一个参数,天和月也只能选一个参数

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

POST /v1/sim-cards/batch-daily-flow

请求参数

表1 请求Body参数

参数

是否必选

参数类型

描述

sim_card_ids

Array of longs

SIM卡标识列表

iccids

Array of strings

容器ID列表

month

String

月份,格式YYYYMM

date

String

日期,格式YYYYMMDD

响应参数

状态码: 200

表2 响应Body参数

参数

参数类型

描述

[数组元素]

Array<Array<SimCardFlowPerDayRsp>>

OK

表3 SimCardFlowPerDayRsp

参数

参数类型

描述

date

String

日期

sim_flow

Array of SimCardFlowItem objects

卡日用量列表

表4 SimCardFlowItem

参数

参数类型

描述

sim_card_id

Long

sim卡标识

iccid

String

容器ID

flow

Double

流量,单位MB

状态码: 400

表5 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

  • 使用sim卡标识按月查询SIM卡的日用量

    POST https://{endpoint}/v1/sim-cards/batch-daily-flow
    
    {
      "month" : "202408",
      "sim_card_ids" : [ 5702790861709056, 5702790861709057 ]
    }
  • 使用容器ID按天查询SIM卡的日用量

    POST https://{endpoint}/v1/sim-cards/batch-daily-flow
    
    {
      "date" : 20240821,
      "iccids" : [ "898600xxxxxxxxxx", "898601xxxxxxxxxx" ]
    }

响应示例

状态码: 200

OK

[ {
  "date" : "20240801",
  "sim_flow" : [ {
    "flow" : 0.98,
    "iccid" : "898600xxxxxxxxxx",
    "sim_card_id" : 5702790861709056
  }, {
    "flow" : 1.0,
    "iccid" : "898601xxxxxxxxxx",
    "sim_card_id" : 5702790861709057
  } ]
}, {
  "date" : "20240802",
  "sim_flow" : [ {
    "flow" : 0.98,
    "iccid" : "898600xxxxxxxxxx",
    "sim_card_id" : 5702790861709056
  }, {
    "flow" : 1.0,
    "iccid" : "898601xxxxxxxxxx",
    "sim_card_id" : 5702790861709057
  } ]
} ]

状态码: 400

Bad Request

{
  "error_code" : "GSL.00010004",
  "error_msg" : "参数异常"
}

状态码: 500

Internal Server Error

{
  "error_code" : "GSL.00010003",
  "error_msg" : "系统繁忙,请稍后重试。"
}

状态码

状态码

描述

200

OK

400

Bad Request

500

Internal Server Error

错误码

请参见错误码

相关文档