更新时间:2023-11-21 GMT+08:00
分享

批量查询实体卡流量

功能介绍

批量查询实体卡流量

调试

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

URI

POST /v1/sim-price-plans/usage/batch-query

请求参数

表1 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。通过调用IAM服务 获取IAM用户Token接口获取,接口返回的响应消息头中“X-Subject-Token”就是需要获取的用户Token。简要的获取方法样例请参见 Token认证

表2 请求Body参数

参数

是否必选

参数类型

描述

iccids

Array of strings

iccid列表(三网卡不支持),最大支持50,且iccid和sim_card_id列表二选一

最大长度:64

数组长度:0 - 50

sim_card_ids

Array of longs

sim_card_id列表,最大支持50,且iccid和sim_card_id列表二选一

最小值:0

数组长度:0 - 50

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

[数组元素]

Array of SimCardsFlowVO objects

OK

表4 SimCardsFlowVO

参数

参数类型

描述

id

Long

套餐实例ID

最小值:0

account_id

String

账户ID

最大长度:128

sim_card_id

Long

sim卡ID

最小值:0

price_plan_id

String

套餐ID

最大长度:128

price_plan_name

String

套餐名称

最大长度:128

iccid

String

ICCID,三网卡为在用ICCID

最大长度:64

flow_total

Double

总流量(MB),两位小数

最小值:0

flow_used

Double

已使用流量(MB),两位小数

最小值:0

flow_left

Double

剩余流量(MB),两位小数

状态码: 400

表5 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 403

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

  • 批量查询SIM卡标识为“898606xxxxxxxxxxxx”和“898607xxxxxxxxxxxx”的流量详情。

    POST https://{endpoint}/v1/sim-price-plans/usage/batch-query
    
    {
      "iccids" : [ "898606xxxxxxxxxxxx", "898607xxxxxxxxxxxx" ]
    }
  • 批量查询SIM卡ID为“100000000000”和“100000000001”的流量详情。

    POST https://{endpoint}/v1/sim-price-plans/usage/batch-query
    
    {
      "sim_card_ids" : [ 100000000000, 100000000001 ]
    }

响应示例

状态码: 200

OK

[ {
  "id" : 100000000000,
  "account_id" : "04eexxxxxxxxxx",
  "sim_card_id" : 100000000000,
  "price_plan_id" : "10001",
  "price_plan_name" : "中国联通消费级每月30M联接服务(1年)",
  "iccid" : "898606xxxxxxxxxxxx",
  "flow_total" : 30,
  "flow_used" : 0,
  "flow_left" : 30
}, {
  "id" : 100000000001,
  "account_id" : "04eexxxxxxxxxx",
  "sim_card_id" : 100000000001,
  "price_plan_id" : "10001",
  "price_plan_name" : "中国联通消费级每月30M联接服务(1年)",
  "iccid" : "898607xxxxxxxxxxxx",
  "flow_total" : 30,
  "flow_used" : 0,
  "flow_left" : 30
} ]

状态码: 400

Parameter Invalid

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

状态码: 403

Forbidden

{
  "error_code" : "GSL.00010001",
  "error_msg" : "请求携带的token无效。"
}

状态码: 500

Internal Server Error

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

状态码

状态码

描述

200

OK

400

Parameter Invalid

403

Forbidden

500

Internal Server Error

错误码

请参见错误码

分享:

    相关文档

    相关产品