Create Alibaba Cloud SMS Endpoint

POST/zstack/v1/sns/sms-endpoints/aliyunsms

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "accessKeyUuid": "4eb00e2bf95bp5s505e6eccd647d9k35",
    "receivers": [
      "13555555555",
      "18666666666"
    ],
    "name": "AliyunSms",
    "description": "This is an Aliyun SMS Endpoint"
  },
  "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":{"accessKeyUuid":"4eb00e2bf95bp5s505e6eccd647d9k35","receivers":["13555555555","18666666666"],"name":"AliyunSms","description":"This is an Aliyun SMS Endpoint"}}' http://localhost:8080/zstack/v1/sns/sms-endpoints/aliyunsms

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
accessKeyUuidStringbody (Contained in the params structure)Alibaba Cloud AccessKey UUID 3.7.0
receivers (Optional)Listbody (Contained in the params structure)SMS receivers 3.7.0
nameStringbody (Contained in the params structure)Endpoint name 3.7.0
description (Optional)Stringbody (Contained in the params structure)Detailed description of the endpoint 3.7.0
platformUuid (Optional)Stringbody (Contained in the params structure)  3.7.0
resourceUuid (Optional)Stringbody (Contained in the params structure)  3.7.0
tagUuids (Optional)Listbody (Contained in the params structure)Tag UUID list 3.7.0
systemTags (Optional)ListbodySystem tags 3.7.0
userTags (Optional)ListbodyUser tags 3.7.0

API Response

Response example

{
  "inventory": {
    "name": "example",
    "uuid": "041723a4d9d14e8686dbec7d1369c05e",
    "description": "example SNSSmsEndpoint Description",
    "type": "AliyunSms",
    "state": "Enabled",
    "platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
    "createDate": "Mar 26, 2024 2:43:19 AM",
    "lastOpDate": "Mar 26, 2024 2:43:19 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
inventorySNSSmsEndpointInventoryFor 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
receiversListSMS receivers3.7.0
nameStringSMS endpoint name3.7.0
uuidStringThe UUID of the SMS endpoint, uniquely identifying this resource3.7.0
descriptionStringDetailed description of the SMS endpoint3.7.0
typeStringSMS endpoint type3.7.0
stateStringSMS endpoint state3.7.0
platformUuidString 3.7.0
createDateTimestampCreation time3.7.0
lastOpDateTimestampLast modification time3.7.0

SDK Examples

Java SDK

CreateSNSAliyunSmsEndpointAction action = new CreateSNSAliyunSmsEndpointAction();
action.accessKeyUuid = "4eb00e2bf95bp5s505e6eccd647d9k35";
action.receivers = asList("13555555555","18666666666");
action.name = "AliyunSms";
action.description = "This is an Aliyun SMS Endpoint";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSAliyunSmsEndpointAction.Result res = action.call();

Python SDK

CreateSNSAliyunSmsEndpointAction action = CreateSNSAliyunSmsEndpointAction()
action.accessKeyUuid = "4eb00e2bf95bp5s505e6eccd647d9k35"
action.receivers = [13555555555, 18666666666]
action.name = "AliyunSms"
action.description = "This is an Aliyun SMS Endpoint"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSAliyunSmsEndpointAction.Result res = action.call()