Add Email Address to SNS Email Endpoint

POST/zstack/v1/sns/application-endpoints/emails/email-addresses

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "emailAddress": "example@cloud.io",
    "endpointUuid": "74220bbf0d8b3c6b943a294c2679ca69"
  },
  "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":{"emailAddress":"example@cloud.io","endpointUuid":"74220bbf0d8b3c6b943a294c2679ca69"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/emails/email-addresses

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
emailAddressStringbody (Contained in the params structure)Email address 3.7.0
endpointUuidStringbody (Contained in the params structure)Endpoint UUID 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)Listbody  3.7.0
userTags (Optional)Listbody  3.7.0

API Response

Response example

{
  "inventory": {
    "uuid": "bb8164224a924d0e893a41a3bad86169",
    "emailAddress": "example@zstack.io",
    "endpointUuid": "5aed9326cdeb4cf39a5f83860256b6e6",
    "createDate": "Mar 26, 2024 2:42:53 AM",
    "lastOpDate": "Mar 26, 2024 2:42:53 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
inventorySNSEmailAddressInventoryFor 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.10013.7.0
descriptionStringA brief description of the error3.7.0
detailsStringDetailed information about the error3.7.0
elaborationStringReserved field. Defaults to null3.7.0
opaqueLinkedHashMapReserved field. Defaults to null3.7.0
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause3.7.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource, uniquely identifying this resource3.7.0
emailAddressString 3.7.0
endpointUuidString 3.7.0
createDateTimestampCreation time5.0.0
lastOpDateTimestampLast modification time5.0.0

SDK Examples

Java SDK

AddEmailAddressToSNSEmailEndpointAction action = new AddEmailAddressToSNSEmailEndpointAction();
action.emailAddress = "example@cloud.io";
action.endpointUuid = "74220bbf0d8b3c6b943a294c2679ca69";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddEmailAddressToSNSEmailEndpointAction.Result res = action.call();

Python SDK

AddEmailAddressToSNSEmailEndpointAction action = AddEmailAddressToSNSEmailEndpointAction()
action.emailAddress = "example@cloud.io"
action.endpointUuid = "74220bbf0d8b3c6b943a294c2679ca69"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddEmailAddressToSNSEmailEndpointAction.Result res = action.call()