华为云用户手册

  • URI GET /v1/sim-price-plans 表1 Query参数 参数 是否必选 参数类型 描述 sim_card_id 是 Long SIM卡标识,可通过查询SIM卡列表接口获取 最小值:0 iccid 否 String iccid,传入的SIM卡标识(sim_card_id)为0,则根据iccid进行处理 最小长度:19 最大长度:20 real_time 否 Boolean 是否查实时流量 缺省值:false limit 否 Long 分页查询时每页显示的记录数,默认值为10,取值范围为10-500的整数 最小值:10 最大值:500 缺省值:10 offset 否 Long 分页查询时的页码数,默认值为1,取值范围为1-1000000的整数 最小值:1 最大值:1000000 缺省值:1
  • 响应示例 状态码: 200 OK { "work_order_id" : 1000001} 状态码: 400 Parameter Invalid { "error_code" : "GSL.00010004", "error_msg" : "参数异常"} 状态码: 500 Internal Server Error { "error_code" : "GSL.00010003", "error_msg" : "系统繁忙,请稍后重试。"}
  • 请求示例 创建SIM卡机卡重绑申请。将SIM卡通过固定机卡重绑方式,绑定到IMEI为”84584xxxxxx“的设备上。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/bind-device{ "bind_type" : 2, "imei" : "84584xxxxxx"} 创建SIM卡机卡重绑申请。通过普通机卡重绑方式,当参数sim_card_id为最小值时,将卡标识iccid为“898600xxxxxxxxxx”的SIM卡绑定到正在使用的设备上。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/bind-device{ "bind_type" : 1, "iccid" : "898600xxxxxxxxxx"}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 work_order_id Long 业务受理单号 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用 IAM 服务 获取IAM用户Token接口获取,接口返回的响应消息头中“X-Subject-Token”就是需要获取的用户Token。简要的获取方法样例请参见 Token认证。 表3 请求Body参数 参数 是否必选 参数类型 描述 bind_type 是 Integer 绑定类型(1:普通机卡重绑,2:固定机卡重绑) 最小值:1 最大值:2 imei 否 String 设备IMEI,84584xxxxxx iccid 否 String iccid,传入的sim_card_id为0,则根据iccid进行处理 最小长度:19 最大长度:20
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务 获取IAM用户Token接口获取,接口返回的响应消息头中“X-Subject-Token”就是需要获取的用户Token。简要的获取方法样例请参见 Token认证。 表3 请求Body参数 参数 是否必选 参数类型 描述 down_up_switch 否 Integer 启用停用开关 最小值:0 最大值:9 iccid 否 String iccid,传入的sim_card_id为0,则根据iccid进行处理 最小长度:19 最大长度:20
  • 响应示例 状态码: 200 OK { "work_order_id" : 1000001} 状态码: 400 Parameter Invalid { "error_code" : "GSL.00010004", "error_msg" : "参数异常"} 状态码: 403 Forbidden { "error_code" : "GSL.00016010", "error_msg" : "您操作的卡仍有未完成的停机受理单,请勿重复操作。"} 状态码: 500 Internal Server Error { "error_code" : "GSL.00010003", "error_msg" : "系统繁忙,请稍后重试。"}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 work_order_id Long 业务受理单号 状态码: 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卡停机申请,停用sim_card_id对应的卡片。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/stop{ "down_up_switch" : 1} 创建SIM卡停机申请。当参数sim_card_id为最小值时,根据iccid,停用卡标识为“8986xxxxxxx”的SIM卡。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/stop{ "down_up_switch" : 1, "iccid" : "8986xxxxxxx"}
  • 响应参数 状态码: 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 { "id" : 1000001} 状态码: 400 Bad Request 示例 1 { "error_code" : "GSL.00020004", "error_msg" : "参数异常"} 示例 2 { "error_code" : "GSL.00027001", "error_msg" : "自定义属性名称不合法,请检查!"} 示例 3 { "error_code" : "GSL.00027002", "error_msg" : "自定义属性名称已存在,请重新输入!"} 示例 4 { "error_code" : "GSL.00027003", "error_msg" : "自定义属性名称和SIM卡管理列字段重复,请重新输入!"} 示例 5 { "error_code" : "GSL.00027004", "error_msg" : "登录用户最多可以创建6个自定义属性。"} 状态码: 500 Internal Server Error { "error_code" : "GSL.00020003", "error_msg" : "系统繁忙,请稍后重试。"}
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 id Long 自定义属性标识 状态码: 400 表3 响应Body参数 参数 参数类型 描述 error_code String 错误码 最大长度:64 error_msg String 错误描述 最大长度:512 状态码: 500 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码 最大长度:64 error_msg String 错误描述 最大长度:512
  • 响应示例 状态码: 200 OK { "limit" : 10, "offset" : 1, "count" : 1, "pools" : [ { "id" : 1000000000, "pool_name" : "流量池名称", "price_plan_name" : "中国联通消费级每月30M联接服务(1年)", "price_plan_id" : "10000", "effective_time" : "2022-08-26T16:00:00.000+00:00", "expired_time" : "2022-09-26T15:59:59.000+00:00", "billing_cycle" : "2022-09", "flow_total" : 60, "flow_used" : 102.59, "flow_left" : -42.59, "quantity" : 100, "modify_time" : "2022-09-22T18:57:15.000+00:00", "order_id" : 100000000, "activated_sim_quantity" : 2, "inactive_sim_quantity" : 0, "disassembled_sim_quantity" : 98, "order_ids" : "1000000", "status" : 1 } ]} 状态码: 400 Bad Request { "error_code" : "GSL.00010004", "error_msg" : "参数异常"} 状态码: 403 Forbidden { "error_code" : "GSL.00011004", "error_msg" : "账期不合法,请检查!"} 状态码: 500 Internal Server Error { "error_code" : "GSL.00010003", "error_msg" : "系统繁忙,请稍后重试。"}
  • URI GET /v1/sim-pools 表1 Query参数 参数 是否必选 参数类型 描述 pool_name 否 String 流量池名称 最大长度:100 limit 否 Long 分页查询时每页显示的记录数,默认值为10,取值范围为10-500的整数 最小值:10 最大值:500 缺省值:10 offset 否 Long 分页查询时的页码数,默认值为1,取值范围为1-1000000的整数 最小值:1 最大值:1000000 缺省值:1 billing_cycle 否 String 账期,例如:2021-04 最小长度:7 最大长度:7 all_billing_cycle 否 Boolean 是否查询近六个月账期标识 缺省值:false status 否 Array of integers 流量池状态,0:废弃,1:在用 最小值:0 最大值:9 数组长度:0 - 9
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 limit Long 每页记录数 offset Long 页码 count Long 当前查询条件的流量池总数 pools Array of SimPoolVO objects 当前页的流量池记录列表 表4 SimPoolVO 参数 参数类型 描述 id Long 流量池标识 pool_name String 流量池名称 最大长度:100 price_plan_name String 套餐名称 最大长度:128 price_plan_id String 套餐标识 最大长度:36 effective_time String 生效时间 expired_time String 失效时间 billing_cycle String 账期 最大长度:7 flow_total Double 可用流量(查询账期所在月份),单位MB 最小值:0 flow_used Double 已用流量(查询账期所在月份), 单位MB 最小值:0 flow_left Double 剩余流量(查询账期所在月份), 单位MB 最小值:0 quantity Integer 流量池成员数量 modify_time String 更新时间 order_id Long 批次号 activated_sim_quantity Integer 已激活成员数量 inactive_sim_quantity Integer 未激活成员数量 disassembled_sim_quantity Integer 已拆机成员数量 order_ids String 组成流量池的批次号列表 最大长度:400 status Integer 流量池状态,0:废弃,1:在用 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 最大长度:64 error_msg String 错误描述 最大长度:512 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 最大长度:64 error_msg String 错误描述 最大长度:512 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 最大长度:64 error_msg String 错误描述 最大长度:512
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 limit Long 每页记录数 offset Long 页码 count Long 总数 sim_cards Array of SimDeviceVO objects sim卡数据集合 表4 SimDeviceVO 参数 参数类型 描述 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 错误描述 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 200 OK { "limit" : 10, "offset" : 1, "count" : 1, "sim_cards" : [ { "sim_card_id" : 4900000000000, "account_id" : "04eef84xxxxxxxxxxx", "cid" : "8986xxxxxxxxxx", "sim_pool_id" : 4940000000, "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" : "8986xxxxxxxxxxx", "network_type" : null, "dbm" : null, "signal_level" : null, "sim_type" : 3, "tag_names" : null, "order_id" : 494000000000, "expire_time" : "2023-08-26T15:59:59.000+00:00", "price_plan_name" : "中国联通消费级每月30M联接服务(1年)", "sim_price_plan_id" : null, "flow_left" : 30, "flow_used" : 0, "operator_status" : 5, "msisdn" : "86xxxxxxxxx", "imsi" : "46xxxxxxxxxx", "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" : "参数异常"} 状态码: 403 Forbidden { "error_code" : "GSL.00016016", "error_msg" : "5分钟内不允许重复操作,请稍作等待。"} 状态码: 500 Internal Server Error { "error_code" : "GSL.00010003", "error_msg" : "系统繁忙,请稍后重试。"}
  • URI GET /v1/sim-cards 表1 Query参数 参数 是否必选 参数类型 描述 main_search_type 否 Integer 查询关键标识类型: 1.容器ID(不同类型卡含义如下:ICCID(实体卡),EID(eSIM)CID(vSIM)) 2.批次号 3.设备IMEI 最小值:0 最大值:99 main_search_key 否 String 查询关键标识值:根据查询关键标识类型进行查询,例如想根据ICCID=xxx进行查询,则main_search_type=1&main_search_key=xxx 最小长度:0 最大长度:128 limit 否 Long 分页查询时每页显示的记录数,默认值为10,取值范围为10-500的整数 最小值:10 最大值:500 缺省值:10 offset 否 Long 分页查询时的页码数,默认值为1,取值范围为1-1000000的整数 最小值:1 最大值:1000000 缺省值:1 sim_status 否 Integer sim卡状态: 10.可测试 11.未激活 13.可激活 14.已停用 20.在用 30.已拆机 最小值:0 最大值:99 device_status 否 Integer 设备状态: 1.注册 2.重启 3.在线 4.离线 最小值:0 最大值:99 tag_id 否 Array of longs 标签ID,最多支持传10个 数组长度:0 - 10 sim_type 否 Integer sim卡类型: 1.vSIM 2.eSIM 3.实体卡 最小值:0 最大值:99 order 否 String 排序的顺序,asc表示顺序排序,desc表示倒序排序,不传则默认asc 缺省值:asc sort 否 String 排序的属性,目前支持:cid(容器ID)、flow_used(已用流量)、flow_left(剩余流量)、act_date(激活时间)、expire_time(到期时间) msisdn 否 String MSISDN 最小长度:0 最大长度:32 customer_attribute1 否 String 自定义属性一 最小长度:0 最大长度:100 customer_attribute2 否 String 自定义属性二 最小长度:0 最大长度:100 customer_attribute3 否 String 自定义属性三 最小长度:0 最大长度:100 customer_attribute4 否 String 自定义属性四 最小长度:0 最大长度:100 customer_attribute5 否 String 自定义属性五 最小长度:0 最大长度:100 customer_attribute6 否 String 自定义属性六 最小长度:0 最大长度:100 min_used_flow 否 Long 最小使用流量(MB) 最小值:0 最大值:2147483647 max_used_flow 否 Long 最大使用流量(MB) 最小值:0 最大值:2147483647 min_left_flow 否 Long 最小剩余流量(MB) 最小值:0 最大值:2147483647 max_left_flow 否 Long 最大剩余流量(MB) 最小值:0 最大值:2147483647 real_named 否 Boolean 是否已实名认证: true表示是,false表示否,系统SIM卡实名认证状态非实时。 order_id 否 Long 订单号 最小值:0 最大值:9223372036854774784 filter_downtime_period 否 Boolean 是否过滤停机保号的卡 缺省值:false order_ids 否 Array of longs 订单批次号集合 price_plan_id 否 Array of strings 套餐id集合,最多支持传30个 pool_flag 否 Integer 流量池标识:0 不使用流量池,1 创建新前向流量池,2 加入已有前向流量池,11 创建新后向流量池,12 加入后向流量池
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 work_order_id Long 业务受理单号 状态码: 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 错误描述
  • 响应示例 状态码: 200 OK { "work_order_id" : 1000001} 状态码: 400 Parameter Invalid { "error_code" : "GSL.00010004", "error_msg" : "参数异常"} 状态码: 403 Forbidden { "error_code" : "GSL.00016015", "error_msg" : "您操作的卡仍有未完成的激活受理单,请勿重复操作。"} 状态码: 500 Internal Server Error { "error_code" : "GSL.00010003", "error_msg" : "系统繁忙,请稍后重试。"}
  • URI POST /v1/sim-cards/{sim_card_id}/enable 表1 路径参数 参数 是否必选 参数类型 描述 sim_card_id 是 Long SIM卡标识,如果SIM卡标识传0则表示需要根据iccid处理。可通过查询SIM卡列表接口获取 最小值:0 表2 Query参数 参数 是否必选 参数类型 描述 iccid 否 String iccid,传入的sim_card_id为0,则根据iccid进行处理 最小长度:19 最大长度:20
  • 请求示例 创建激活SIM卡申请,将sim_card_id对应的SIM卡激活。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/enable 创建激活SIM卡申请。当参数sim_card_id为最小值时,将卡标识iccid为“8986xxxxxxxxxxxxxxx”的SIM卡激活。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/enable{ "iccid" : "8986xxxxxxxxxxxxxxx"}
  • 请求示例 创建SIM卡复机申请,将sim_card_id对应的卡片操作为复用。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/reset{ "down_up_switch" : 2} 创建SIM卡复机申请。当参数sim_card_id为最小值时,根据iccid,复用卡标识为“8986xxxxxxx”的SIM卡。 POST https://{endpoint}/v1/sim-cards/{sim_card_id}/reset{ "down_up_switch" : 2, "iccid" : "8986xxxxxxx"}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 work_order_id Long 业务受理单号 状态码: 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 错误描述
  • 响应示例 状态码: 200 OK { "work_order_id" : 1000001} 状态码: 400 Parameter Invalid { "error_code" : "GSL.00010004", "error_msg" : "参数异常"} 状态码: 403 Forbidden { "error_code" : "GSL.00016010", "error_msg" : "您操作的卡仍有未完成的停机受理单,请勿重复操作。"} 状态码: 500 Internal Server Error { "error_code" : "GSL.00010003", "error_msg" : "系统繁忙,请稍后重试。"}
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务 获取IAM用户Token接口获取,接口返回的响应消息头中“X-Subject-Token”就是需要获取的用户Token。简要的获取方法样例请参见 Token认证。 表3 请求Body参数 参数 是否必选 参数类型 描述 down_up_switch 否 Integer 启用停用开关 最小值:0 最大值:9 iccid 否 String iccid,传入的sim_card_id为0,则根据iccid进行处理 最小长度:19 最大长度:20
  • 准备环境 已获取API的 域名 、请求url、请求方法、AppKey和AppSecret等信息,具体参见认证前准备。 获取并安装Python安装包(可使用2.7.9+或3.X),如果未安装,请至Python官方下载页面下载。 Python安装完成后,在cmd/shell窗口中使用pip安装“requests”库。 pip install requests 如果pip安装requests遇到证书错误,请下载并使用Python执行此文件,升级pip,然后再执行以上命令安装。 获取并安装IntelliJ IDEA,如果未安装,请至IntelliJ IDEA官方网站下载。 已在IntelliJ IDEA中安装Python插件,如果未安装,请按照图1所示安装。 图1 安装Python插件
  • 调用API示例 在工程中引入apig_sdk。 12 from apig_sdk import signerimport requests 生成一个新的Signer,填入AppKey和AppSecret。 123 sig = signer.Signer()sig.Key = "4f5f626b-073f-402f-a1e0-e52171c6100c"sig.Secret = "******" 生成一个Request对象,指定方法名、请求uri、header和body。 1234 r = signer.HttpRequest("POST", "https://c967a237-cd6c-470e-906f-a8655461897e.apigw.exampleRegion.com/app1?a=1", {"x-stage": "RELEASE"}, "body") 进行签名,执行此函数会在请求参数中添加用于签名的X-Sdk-Date头和Authorization头。 X-Sdk-Date是一个必须参与签名的请求消息头参数。 1 sig.Sign(r) 访问API,查看访问结果。 123 resp = requests.request(r.method, r.scheme + "://" + r.host + r.uri, headers=r.headers, data=r.body)print(resp.status_code, resp.reason)print(resp.content)
共100000条
提示

您即将访问非华为云网站,请注意账号财产安全