AddSNSSmsReceiver

API Request

URLs
POST zstack/v1/sns/sms-endpoints/receivers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "phoneNumber": "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","endpointUuid":"467e77c4cc42492f9794429e689a9874","type":"AliyunSms","description":"description"}}' http://localhost:8080/zstack/v1/sns/sms-endpoints/receivers
Request Parameters
Name Type Location Description Optional Value Starting Version
phoneNumber String body (contained in the params structure) The phone number to receive SMS messages. 3.7.0
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 type of the SMS message endpoint.
  • AliyunSms
3.7.0
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
{
  "inventory": {
    "uuid": "54f2c73bbdd24bd383bc898c94e4e157",
    "phoneNumber": "18912345678",
    "endpointUuid": "e0a8e9de43774027a486f3a47fa0b46c",
    "type": "AliyunSms",
    "description": "description",
    "createDate": "Oct 11, 2019 2:55:42 PM",
    "lastOpDate": "Oct 11, 2019 2:55:42 PM"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.7.0
inventory SNSSmsReceiverInventory See inventory. 3.7.0
#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
#inventory
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

SDK Sample

Java SDK
AddSNSSmsReceiverAction action = new AddSNSSmsReceiverAction();
action.phoneNumber = "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.endpointUuid = "467e77c4cc42492f9794429e689a9874"
action.type = "AliyunSms"
action.description = "description"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSNSSmsReceiverAction.Result res = action.call()