AddSNSSmsReceiver
API Request
URLs
POST zstack/v1/sns/sms-endpoints/receiversHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"phoneNumber": "13333333333",
"phoneNumberList": [
"13333333333"
],
"endpointUuid": "467e77c4cc42492f9794429e689a9874",
"type": "AliyunSms",
"description": "description"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"phoneNumber":"13333333333","phoneNumberList":["13333333333"],"endpointUuid":"467e77c4cc42492f9794429e689a9874","type":"AliyunSms","description":"description"}}' http://localhost:8080/zstack/v1/sns/sms-endpoints/receiversRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| phoneNumber | String | body (contained in the params structure) | Optional. The phone number to receive SMS messages. | 3.7.0 | |
| phoneNumberList | List | body (contained in the params structure) | Optional. The list of phone numbers to receive SMS messages. | 5.1.8 | |
| endpointUuid | String | body (contained in the params structure) | The UUID of the SMS message endpoint. | 3.7.0 | |
| type | String | body (contained in the params structure) | The SMS endpoint type. |
|
5.1.8 |
| description | String | body (contained in the params structure) | Optional. The description of the SMS message receiver. | 3.7.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 3.7.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
Sample
Response
{
"inventories": [
{
"uuid": "d122a14806e8405894d00034b0a91dd1",
"phoneNumber": "18912345678",
"endpointUuid": "d539f1d109534f90b0cbf50cff412585",
"type": "AliyunSms",
"description": "description",
"createDate": "Jun 13, 2024 5:29:04 PM",
"lastOpDate": "Jun 13, 2024 5:29:04 PM"
}
]
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 5.0.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventories | SNSSmsReceiverInventory | See inventories. | 5.1.8 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| phoneNumber | String | The phone number to receive SMS messages. | 3.7.0 |
| endpointUuid | String | The UUID of the SMS message endpoint. | 3.7.0 |
| description | String | The description of the SMS message receiver. | 3.7.0 |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| type | SmsReceiverType | See type. | 3.7.0 |
#type
| Name | Type | Description | Starting Version |
|---|---|---|---|
| AliyunSms | SmsReceiverType | The Aliyun SMS message. | 3.7.0 |
| UniversalSms | SmsReceiverType | The universal SMS message. | 5.1.8 |
SDK Sample
Java
SDK
AddSNSSmsReceiverAction action = new AddSNSSmsReceiverAction();
action.phoneNumber = "13333333333";
action.phoneNumberList = asList("13333333333");
action.endpointUuid = "467e77c4cc42492f9794429e689a9874";
action.type = "AliyunSms";
action.description = "description";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSNSSmsReceiverAction.Result res = action.call();
Python
SDK
AddSNSSmsReceiverAction action = AddSNSSmsReceiverAction()
action.phoneNumber = "13333333333"
action.phoneNumberList = [13333333333]
action.endpointUuid = "467e77c4cc42492f9794429e689a9874"
action.type = "AliyunSms"
action.description = "description"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSNSSmsReceiverAction.Result res = action.call()
