CreateSNSEmailEndpoint
API Request
URLs
POST zstack/v1/sns/application-endpoints/emailsHeaders
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": {
"email": "example@zstack.io",
"emails": [
"example@zstack.io"
],
"name": "email",
"platformUuid": "5efc525948a537e39a91290c57d6d37b"
},
"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":{"email":"example@zstack.io","emails":["example@zstack.io"],"name":"email","platformUuid":"5efc525948a537e39a91290c57d6d37b"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/emailsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| String | body (contained in the params structure) | Optional. The email address. | 2.3.0 | ||
| emails | List | body (contained in the params structure) | Optional. | 3.7.0 | |
| name | String | body (contained in the params structure) | The resource name. | 5.0.0 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 5.0.0 | |
| platformUuid | String | body (contained in the params structure) | Optional. The application platform UUID. | 5.0.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. | 5.0.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": "Dec 25, 2023 2:03:24 PM",
"lastOpDate": "Dec 25, 2023 2:03:24 PM"
}
}#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 |
| 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()