CreateSNSEmailEndpoint
API Request
URLs
POST zstack/v1/sns/application-endpoints/emails
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"email": "example@zstack.io",
"emails": [
"example@zstack.io"
],
"name": "email",
"platformUuid": "5efc525948a537e39a91290c57d6d37b"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"email":"example@zstack.io","emails":["example@zstack.io"],"name":"email","platformUuid":"5efc525948a537e39a91290c57d6d37b"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/emails
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
String | body | The email address. | 2.3.0 | ||
emails | List | body (contained in the params structure) | Optional. | 3.7.0 | |
name | String | body | The resource name. | 2.3.0 | |
description | String | body | Optional. The detailed description of the resource. | 2.3.0 | |
platformUuid | String | body | Optional. The application platform UUID. | 2.3.0 | |
resourceUuid | String | body | Optional. | 2.3.0 | |
tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.7.0 | |
systemTags | List | body | Optional. The system tags. | 2.3.0 | |
userTags | List | body | Optional. The user tags. | 2.3.0 |
API Response
Sample
Response
{
"inventory": {
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Sep 6, 2019 2:52:41 PM",
"lastOpDate": "Sep 6, 2019 2:52:41 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. | 2.3 |
inventory | SNSApplicationEndpointInventory | See inventory. | 2.3 |
#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 |
---|---|---|---|
name | String | The resource name. | 2.3 |
uuid | String | The resource UUID. | 2.3 |
description | String | The detailed description of the resource. | 2.3 |
type | String | The type. | 2.3 |
state | String | 2.3 | |
platformUuid | String | The application platform UUID. | 2.3 |
createDate | Timestamp | The creation date. | 2.3 |
lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
Java
SDK
CreateSNSEmailEndpointAction action = new CreateSNSEmailEndpointAction();
action.email = "example@zstack.io";
action.emails = asList("example@zstack.io");
action.name = "email";
action.platformUuid = "5efc525948a537e39a91290c57d6d37b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSEmailEndpointAction.Result res = action.call();
Python
SDK
CreateSNSEmailEndpointAction action = CreateSNSEmailEndpointAction()
action.email = "example@zstack.io"
action.emails = [example@zstack.io]
action.name = "email"
action.platformUuid = "5efc525948a537e39a91290c57d6d37b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSEmailEndpointAction.Result res = action.call()