You can update information about the configuration of a specific email server, such as the host name and port number.
Execution permission
Admin
Request line
PUT baseURL/v1/objects/EmailServerSettings/{id}
Request body
The structure of the request body and the object attributes are as follows:EmailSetting
{
"instanceID":"...",
"hostname":"...",
"authenticationEnabled":"...",
"userId":"...",
"updatePassword":"...",
"password":"...",
"senderAddress":"...",
"secureConnection":"...",
"portNumber":"..."
}
EmailSetting (Type: EmailSetting)
|
Attribute |
Type |
Description |
|---|---|---|
|
instanceID |
string |
ID of the mail server settings |
|
hostname |
string |
IP address or host name of the SMTP server |
|
authenticationEnabled |
boolean |
Whether or not to enable authentication of the user who sends emails. If enabled, "true" is set. If disabled, "false" is set. |
|
userId |
string |
User ID used for authentication of the user who sends emails. This item is set only if authenticationEnabled is "true". |
|
updatePassword |
boolean |
Whether or not to change the password that is used to authenticate the email sender. Specify this item if the password needs to be changed when the mail server settings are changed. To change the password, specify "true". To not change the password, specify "false". |
|
password |
string |
Password used for authentication of the user who sends emails. Specify a string encoded in Base64. |
|
senderAddress |
string |
Sender address |
|
secureConnection |
enum |
Setting of security used when emails are sent (For details about the valid values, see the table SecureConnectionType in List of enumerators.)
|
|
portNumber |
int |
Port number used for connection to the SMTP server |
Response body
The structure of the response body and the object attributes is as follows:EmailSetting
{
"instanceID":"...",
"hostname":"...",
"authenticationEnabled":"...",
"userId":"...",
"senderAddress":"...",
"secureConnection":"...",
"portNumber":"..."
}
EmailSetting (Type: EmailSetting)
|
Attribute |
Type |
Description |
|---|---|---|
|
instanceID |
string |
ID of the mail server settings |
|
hostname |
string |
IP address or host name of the SMTP server |
|
authenticationEnabled |
boolean |
Whether or not to enable authentication of the user who sends emails. If enabled, "true" is set. If disabled, "false" is set. |
|
userId |
string |
User ID used for authentication of the user who sends emails. This item is set only if authenticationEnabled is "true". |
|
senderAddress |
string |
Sender address |
|
secureConnection |
enum |
Setting of security used when emails are sent (For details about the valid values, see the table SecureConnectionType in List of enumerators.)
|
|
portNumber |
int |
Port number used for connection to the SMTP server |
Status codes
|
Status code |
Reason phrase |
Description |
|---|---|---|
|
200 |
OK |
Success. |
|
400 |
Bad Request |
The format of the request body is invalid. |
|
401 |
Unauthorized |
No login privilege. |
|
403 |
Forbidden |
No update privilege. |
|
412 |
Precondition Failed |
The server is not available. |
|
500 |
Internal Server Error |
Server processing error. |
Example code
[Request Header]
PUT /Analytics/v1/objects/EmailServerSettings/mailServerSetting%230
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
Host: localhost:22015
Accept: application/json
Content-Type: application/json
[Request Body]
{
"instanceID":1234568790,
"hostname":"172.17.17.116",
"authenticationEnabled":true,
"userId":"user1",
"updatePassword":true,
"password":"a2FzaGltYTE=",
"senderAddress":"user@example.com",
"secureConnection":"Plain",
"portNumber":25
}
[Response Header]
HTTP/1.1 200 OK
Date: Wed, 20 Jul 2016 02:50:44 GMT
Server: Cosminexus HTTP Server
Cache-Control: no-cache
WWW-Authenticate: HSSO 33659a74fcee4358dc272b34eca6ded1bf1131ec_YXZvNFIMehp3UB4jbmVyPGUgT3Q=_V0810
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Transfer-Encoding: chunked
Content-Type: application/json
[Response Body]
{
"instanceID" : "mailServerSetting#0",
"hostname" : "172.17.17.116",
"authenticationEnabled" : false,
"userId" : "user1",
"senderAddress" : "user@example.com",
"secureConnection" : "Plain",
"portNumber" : 25
}