批量设置自定义属性接口 - BatchSetAttributes
功能介绍
批量设置自定义属性接口
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
POST /v1/sim-cards/attributes/batch-set
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| file_temp_id | 否 | Long | 临时文件ID,如果通过接口调用,此字段为空 |
| attributes | 否 | Array of AttributeReq objects | 自定义属性集合 数组长度:1 - 500 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| 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 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| - | Boolean | OK |
状态码:400
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 错误码 |
| error_msg | String | 错误描述 |
状态码:500
| 参数 | 参数类型 | 描述 |
|---|---|---|
| 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 |
错误码
请参见错误码。