AddEmailAddressToSNSEmailEndpoint
API Request
URLs
POST zstack/v1/sns/application-endpoints/emails/email-addressesHeaders
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": {
"emailAddress": "example@zstack.io",
"endpointUuid": "74220bbf0d8b3c6b943a294c2679ca69"
},
"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":{"emailAddress":"example@zstack.io","endpointUuid":"74220bbf0d8b3c6b943a294c2679ca69"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/emails/email-addressesRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| emailAddress | String | body (contained in the params structure) | The email address. | 3.7.0 | |
| endpointUuid | String | body (contained in the params structure) | The endpoint UUID. | 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": "02d89445bc1f4e2db80baa734563a312",
"emailAddress": "example@zstack.io",
"endpointUuid": "e99050f8f59649f0a9e842958665f1b3",
"createDate": "Dec 25, 2023 2:04:26 PM",
"lastOpDate": "Dec 25, 2023 2:04:26 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 |
| inventory | SNSEmailAddressInventory | 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. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.7.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| emailAddress | String | 3.7.0 | |
| endpointUuid | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 5.0.0 |
| lastOpDate | Timestamp | The last operation date. | 5.0.0 |
SDK Sample
Java
SDK
AddEmailAddressToSNSEmailEndpointAction action = new AddEmailAddressToSNSEmailEndpointAction();
action.emailAddress = "example@zstack.io";
action.endpointUuid = "74220bbf0d8b3c6b943a294c2679ca69";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddEmailAddressToSNSEmailEndpointAction.Result res = action.call();Python
SDK
AddEmailAddressToSNSEmailEndpointAction action = AddEmailAddressToSNSEmailEndpointAction()
action.emailAddress = "example@zstack.io"
action.endpointUuid = "74220bbf0d8b3c6b943a294c2679ca69"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddEmailAddressToSNSEmailEndpointAction.Result res = action.call()