SNSEmailTestConnection
API Request
URLs
POST zstack/v1/sns/application-endpoints/email/test-connectionHeaders
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": {
"emails": [
"example@zstack.io"
],
"platformUuid": "d5904b92d6df39a5905212bde24b2946",
"endpointUuid": "2ff88c96f20f36469bdfcd2fa84e533d",
"subject": "test email subject",
"text": "this is a test email of content"
},
"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":{"emails":["example@zstack.io"],"platformUuid":"d5904b92d6df39a5905212bde24b2946","endpointUuid":"2ff88c96f20f36469bdfcd2fa84e533d","subject":"test email subject","text":"this is a test email of content"}}' http://localhost:8080/zstack/v1/sns/application-endpoints/email/test-connectionRequest Parameters
| Name | Type | Location | Description | Valid Values | Starting Version |
|---|---|---|---|---|---|
| emails | List | body (contained in the params structure) | Optional. The email addresses. | 5.1.8 | |
| platformUuid | String | body (contained in the params structure) | Optional. The email platform UUID. | 5.1.8 | |
| endpointUuid | String | body (contained in the params structure) | Optional. The email endpoint UUID. | 5.1.8 | |
| subject | String | body (contained in the params structure) | Optional. The subject. | 5.1.8 | |
| text | String | body (contained in the params structure) | Optional. The text. | 5.1.8 | |
| systemTags | List | body | Optional. The system tags. | 5.1.8 | |
| userTags | List | body | Optional. The user tags. | 5.1.8 |
API Response
Sample
Response
{
"connected": true,
"webhookResp": {}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 5.1.8 | |
| connected | boolean | The test text sending result. | 5.1.8 |
| webhookResp | LinkedHashMap | The response from the endpoint. | 5.1.8 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 5.1.8 |
#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. | 5.1.8 |
| description | String | The brief description of the error. | 5.1.8 |
| details | String | The details about the error. | 5.1.8 |
| elaboration | String | The reserved field. Default value: null. | 5.1.8 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 5.1.8 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 5.1.8 |
SDK Sample
Java
SDK
SNSEmailTestConnectionAction action = new SNSEmailTestConnectionAction();
action.emails = asList("example@zstack.io");
action.platformUuid = "d5904b92d6df39a5905212bde24b2946";
action.endpointUuid = "2ff88c96f20f36469bdfcd2fa84e533d";
action.subject = "test email subject";
action.text = "this is a test email of content";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SNSEmailTestConnectionAction.Result res = action.call();Python
SDK
SNSEmailTestConnectionAction action = SNSEmailTestConnectionAction()
action.emails = [example@zstack.io]
action.platformUuid = "d5904b92d6df39a5905212bde24b2946"
action.endpointUuid = "2ff88c96f20f36469bdfcd2fa84e533d"
action.subject = "test email subject"
action.text = "this is a test email of content"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SNSEmailTestConnectionAction.Result res = action.call()