Add SMS Receiver

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": []
}

In the preceding example, the systemTags and userTags fields are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

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

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

phoneNumber

String

body (Contained in the params structure)

SMS receiving phone number

 

3.7.0

endpointUuid

String

body (Contained in the params structure)

SMS endpoint UUID

 

3.7.0

type

String

body (Contained in the params structure)

SMS endpoint type

  • AliyunSms

3.7.0

description (Optional)

String

body (Contained in the params structure)

SMS receiver description

 

3.7.0

resourceUuid (Optional)

String

body (Contained in the params structure)

 

 

3.7.0

tagUuids (Optional)

List

body (Contained in the params structure)

Tag UUID list

 

3.7.0

systemTags (Optional)

List

body

System tags

 

3.7.0

userTags (Optional)

List

body

User tags

 

3.7.0

API Response

Response example

{
  "inventory": {
    "uuid": "fac44d00d50f41fda7c74b753ad4298e",
    "phoneNumber": "18912345678",
    "endpointUuid": "97c6a427da0e4c67ade85f488ddada53",
    "type": "AliyunSms",
    "description": "description",
    "createDate": "Mar 26, 2024 2:46:22 AM",
    "lastOpDate": "Mar 26, 2024 2:46:22 AM"
  }
}
NameTypeDescriptionStarting Version
successboolean 5.0.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error3.7.0
inventorySNSSmsReceiverInventoryFor details, see inventory3.7.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, for example, SYS.1000 or HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource, uniquely identifying this resource3.7.0
phoneNumberStringSMS receiving phone number3.7.0
endpointUuidStringSMS endpoint UUID3.7.0
descriptionStringSMS receiver description3.7.0
createDateTimestampCreation time3.7.0
lastOpDateTimestampLast modification time3.7.0
typeSmsReceiverTypeFor details, see type3.7.0

type

NameTypeDescriptionStarting Version
AliyunSmsSmsReceiverTypeAlibaba Cloud SMS3.7.0

SDK Examples

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()