文档首页> 全球SIM联接 GSL> API参考> API列表> 自定义属性> 批量设置自定义属性接口
更新时间:2023-09-18 GMT+08:00
分享

批量设置自定义属性接口

功能介绍

批量设置自定义属性接口

调试

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

URI

POST /v1/sim-cards/attributes/batch-set

请求参数

表1 请求Body参数

参数

是否必选

参数类型

描述

file_temp_id

Long

临时文件ID,如果通过接口调用,此字段为空

attributes

Array of AttributeReq objects

自定义属性集合

数组长度:1 - 500

表2 AttributeReq

参数

是否必选

参数类型

描述

sim_card_id

Long

SIM卡标识,如果SIM卡标识传0则表示需要根据iccid处理。

iccid

String

iccid,如果SIM卡标识传0则表示需要根据iccid处理。

最小长度:19

最大长度:20

customer_attribute1

String

自定义属性一

最大长度:100

customer_attribute2

String

自定义属性二

最大长度:100

customer_attribute3

String

自定义属性三

最大长度:100

customer_attribute4

String

自定义属性四

最大长度:100

customer_attribute5

String

自定义属性五

最大长度:100

customer_attribute6

String

自定义属性六

最大长度:100

响应参数

状态码: 400

表3 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表4 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

  • 批量设置SIM卡自定义属性。例如:批量设置sim_card_id为“4710200000”和“4710300000”的卡片自定义属性值,自定义属性1为“attr1”。

    POST https://{endpoint}/v1/sim-cards/attributes/batch-set
    
    {
      "attributes" : [ {
        "sim_card_id" : 4710200000,
        "customer_attribute1" : "attr1",
        "customer_attribute2" : "attr2",
        "customer_attribute3" : "attr3",
        "customer_attribute4" : "attr4",
        "customer_attribute5" : "attr5",
        "customer_attribute6" : "attr6"
      }, {
        "sim_card_id" : 4710300000,
        "customer_attribute1" : "attr1",
        "customer_attribute2" : "attr2",
        "customer_attribute3" : "attr3",
        "customer_attribute4" : "attr4",
        "customer_attribute5" : "attr5",
        "customer_attribute6" : "attr6"
      } ]
    }
  • 批量设置SIM卡自定义属性。当参数sim_card_id为最小值时,批量设置卡标识iccid为“8986xxxxxxxxxxxxxxx”和“8987xxxxxxxxxxxxxxx”的卡片自定义属性值,自定义属性1为“attr1”。

    POST https://{endpoint}/v1/sim-cards/attributes/batch-set
    
    {
      "attributes" : [ {
        "sim_card_id" : 0,
        "iccid" : "8986xxxxxxxxxxxxxxx",
        "customer_attribute1" : "attr1",
        "customer_attribute2" : "attr2",
        "customer_attribute3" : "attr3",
        "customer_attribute4" : "attr4",
        "customer_attribute5" : "attr5",
        "customer_attribute6" : "attr6"
      }, {
        "sim_card_id" : 0,
        "iccid" : "8987xxxxxxxxxxxxxxx",
        "customer_attribute1" : "attr1",
        "customer_attribute2" : "attr2",
        "customer_attribute3" : "attr3",
        "customer_attribute4" : "attr4",
        "customer_attribute5" : "attr5",
        "customer_attribute6" : "attr6"
      } ]
    }

响应示例

状态码: 400

Parameter Invalid

  • 示例 1

    {
      "error_code" : "GSL.00010004",
      "error_msg" : "sim_card_id:不能为null"
    }
  • 示例 2

    {
      "error_code" : "GSL.00012031",
      "error_msg" : "[{\"fail_reason\":\"自定义属性三未启用\",\"sim_card_id\":3552016640640009}]"
    }

状态码: 500

Internal Server Error

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

状态码

状态码

描述

200

OK

400

Parameter Invalid

500

Internal Server Error

错误码

请参见错误码

分享:

    相关文档

    相关产品