
# 查询SIM卡详情 - ShowSimCard
#### 功能介绍
查询SIM卡详情
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/GSL/doc?api=ShowSimCard)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-ocgsl/gsl_07_0026.html)。
#### URI
GET /v1/sim-cards/{sim_card_id}
表1路径参数 
| 参数          | 是否必选 | 参数类型 | 描述                                                                                                                      |
|:---|:---|:---|:---|
| sim_card_id | 是    | Long | SIM卡标识，如果SIM卡标识传0则表示需要根据iccid处理。可通过[查询SIM卡列表接口](https://support.huaweicloud.com/api-ocgsl/gsl_07_0008.html)获取 最小值：**0** |
表2Query参数 
| 参数    | 是否必选 | 参数类型   | 描述                            |
|:---|:---|:---|:---|
| iccid | 否    | String | iccid 最小长度：**19** 最大长度：**20** |
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务 [获取IAM用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)接口获取，接口返回的响应消息头中"X-Subject-Token"就是需要获取的用户Token。简要的获取方法样例请参见 [Token认证](https://support.huaweicloud.com/api-ocgsl/gsl_07_0004.html)。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数                     | 参数类型    | 描述                                                                                                      |
|:---|:---|:---|
| sim_card_id            | Long    | sim卡id                                                                                                  |
| account_id             | String  | 账户id                                                                                                    |
| cid                    | String  | 容器ID:不同类型卡含义如下 iccid(实体卡)，eid（eSIM）cid（vSIM)                                                            |
| sim_pool_id            | Long    | 流量池ID                                                                                                   |
| imei                   | String  | 设备IMEI                                                                                                  |
| sim_status             | Integer | sim卡状态： 10.可测试 11.未激活 13.可激活 14.已停用 20.在用 30.已拆机                                                        |
| device_status          | Integer | 设备状态：1.注册 2.重启 3.在线 4.离线（该参数只有ESIM、VSIM返回，实体卡返回null）                                                    |
| device_model           | String  | 设备模组（该参数只有ESIM、VSIM返回，实体卡返回null）                                                                        |
| act_date               | String  | 激活日期 例如2020-01-31T16:00:00.000Z                                                                         |
| device_status_date     | String  | 设备状态变更时间 例如2020-01-31T16:00:00.000Z（该参数只有ESIM、VSIM返回，实体卡返回null）                                         |
| node_id                | String  | 设备标识                                                                                                    |
| iccid                  | String  | 码号iccid                                                                                                 |
| network_type           | String  | 网络类型                                                                                                    |
| dbm                    | String  | 信号强度（该参数只有ESIM、VSIM返回，实体卡返回null）                                                                        |
| signal_level           | String  | 信号等级:1.差 2.良 3.优（该参数只有ESIM、VSIM返回，实体卡返回null）                                                            |
| sim_type               | Integer | sim卡类型 1.vSIM 2.eSIM 3.实体卡                                                                              |
| tag_names              | String  | 标签名                                                                                                     |
| order_id               | Long    | 批次号                                                                                                     |
| expire_time            | String  | 到期时间 例如2021-06-30T00:00:00.000Z                                                                         |
| price_plan_name        | String  | 在用套餐名 最大长度：**128**                                                                                      |
| sim_price_plan_id      | Long    | 套餐订购实例ID                                                                                                |
| flow_left              | Double  | 剩余流量(单位M)，数据默认截止到昨日24点。                                                                                 |
| flow_used              | Double  | 已用流量(单位M)，数据默认截止到昨日24点。                                                                                 |
| operator_status        | Integer | 停机类型 -1.正常（非停机状态） 1.停机（超流量停机） 2.停机（超流量阈值停机） 3.停机（流量池停机） 4.停机（套餐到期停机） 5.停机（主动停机） 6.停机（违规停机） 7.停机（机卡分离停机） |
| msisdn                 | String  | MSISDN 最大长度：**32**                                                                                      |
| imsi                   | String  | IMSI 最大长度：**32**                                                                                        |
| customer_attribute1    | String  | 自定义属性一 最大长度：**100**                                                                                     |
| customer_attribute2    | String  | 自定义属性二 最大长度：**100**                                                                                     |
| customer_attribute3    | String  | 自定义属性三 最大长度：**100**                                                                                     |
| customer_attribute4    | String  | 自定义属性四 最大长度：**100**                                                                                     |
| customer_attribute5    | String  | 自定义属性五 最大长度：**100**                                                                                     |
| customer_attribute6    | String  | 自定义属性六 最大长度：**100**                                                                                     |
| real_named             | Boolean | 是否已实名认证: true表示是，false表示否，系统SIM卡实名认证状态非实时。                                                              |
| cut_net_flag           | Boolean | 是否单独断网 true:断网，false:未断网 （当前只支持联通、移动的组池卡，电信卡不限制）                                                        |
| exceed_cut_net_flag    | Boolean | 是否达量断网 true:达量断网，false:未达量断网 （当前只支持联通、移动的组池卡，电信卡不限制）                                                    |
| exceed_cut_net_quota   | Integer | 达量断网阈值（单位MB 当前仅电信卡支持）                                                                                   |
| imei_bind_remain_times | Integer | 本月机卡绑定剩余次数（当前仅电信卡支持）                                                                                    |
| speed_value            | Integer | 网络限制速率（单位Kbps,当前电信联通卡支持）                                                                                |
   
**状态码：400**
表5响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：500**
表6响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
#### 请求示例
- 查询sim_card_id对应的卡详情信息。
  ```
  GET https://{endpoint} /v1/sim-cards/{sim_card_id}
  ```
- 查询SIM卡详情。当参数sim_card_id为最小值时，查询卡标识iccid为"8986xxxxxxxxxxxxxxx"的SIM卡详情。
  ```
  GET https://{endpoint} /v1/sim-cards/{sim_card_id}
  {
    "iccid" : "8986xxxxxxxxxxxxxxx"
  }
  ```
#### 响应示例
**状态码：200**
OK
```
{
  "sim_card_id" : 10000000000000000,
  "account_id" : "04eexxxxxxxxx",
  "cid" : "8986xxxxxxxxxxxxxxx",
  "sim_pool_id" : 10000000000000000,
  "imei" : null,
  "sim_status" : 14,
  "device_status" : null,
  "device_model" : null,
  "act_date" : "2022-09-16T01:14:58.000+00:00",
  "device_status_date" : null,
  "node_id" : null,
  "iccid" : "8986xxxxxxxxxxxxxxx",
  "network_type" : null,
  "dbm" : null,
  "signal_level" : null,
  "sim_type" : 3,
  "tag_names" : null,
  "order_id" : 10000000000000000,
  "expire_time" : "2023-08-26T15:59:59.000+00:00",
  "price_plan_name" : "中国联通消费级每月30M联接服务（1年）",
  "sim_price_plan_id" : 10000000000000000,
  "flow_left" : 10,
  "flow_used" : 0,
  "operator_status" : 5,
  "msisdn" : "8986xxxxxxxxxxxxxxx",
  "imsi" : "46xxxxxxxxxxxxxxx",
  "customer_attribute1" : null,
  "customer_attribute2" : null,
  "customer_attribute3" : null,
  "customer_attribute4" : null,
  "customer_attribute5" : null,
  "customer_attribute6" : null,
  "real_named" : false,
  "cut_net_flag" : false,
  "exceed_cut_net_flag" : false,
  "exceed_cut_net_quota" : null,
  "imei_bind_remain_times" : null,
  "speed_value" : null
}
```
**状态码：400**
Parameter Invalid
```
{
  "error_code" : "GSL.00010004",
  "error_msg" : "参数异常"
}
```
**状态码：500**
Internal Server Error
```
{
  "error_code" : "GSL.00010003",
  "error_msg" : "系统繁忙，请稍后重试。"
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 400 | Parameter Invalid     |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-ocgsl/ErrorCode.html)。
