cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1552
Views
3
Helpful
11
Replies

Updating SMTP Client Configuration by using Postman failed

eric.yang
Level 1
Level 1

Hi there,

I tried to update smtp configuration by using Postman but failed with error 400 Bad Request. Is there anything wrong?

ericyang_0-1695074789574.png

ericyang_1-1695074800210.png

Thanks.

1 Accepted Solution

Accepted Solutions

Marcel Zehnder
Spotlight
Spotlight

Hi 

Without knowing the CUPI APi. Two points: In the screenshot you provided, it looks like theres a comma missing after the smtpUsername-value - the paylood should look like this:

 

{
    "smtpSmartHost": "smtp.sendgrid.net",
     "isClientSecure": "true",
     "smtpPort": "587",
     "isAuthEnabled": "false",
     "smtpUsername" : "apikey", 
     "smtpPassword" : "yourpassword"
}

 

 

If the comma is there and it's not working, I would give it a try and send the true/false values as booleans instead of strings:

 

{
    "smtpSmartHost": "smtp.sendgrid.net",
     "isClientSecure": true,
     "smtpPort": "587",
     "isAuthEnabled": false,
     "smtpUsername" : "apikey", 
     "smtpPassword" : "yourpassword"
}

 

 

 

View solution in original post

11 Replies 11

b.winter
VIP
VIP

@eric.yang Moved your post to the DevNet / Collaboration forum. Please don't open your post randomly in any forum.
For programming / DevNet related questions, it's good to open new posts in the DevNet forum, and not just in the general Collaboration forum.

I did not find where is the DevNet forum, could you please post the link here? Thanks

Marcel Zehnder
Spotlight
Spotlight

Hi eric, what product/API?

It appears that SMTP client management support appears only as of CUC v14SU2 - are you perhaps using an earlier version?

Unity Connection v14SU3

Marcel Zehnder
Spotlight
Spotlight

Hi 

Without knowing the CUPI APi. Two points: In the screenshot you provided, it looks like theres a comma missing after the smtpUsername-value - the paylood should look like this:

 

{
    "smtpSmartHost": "smtp.sendgrid.net",
     "isClientSecure": "true",
     "smtpPort": "587",
     "isAuthEnabled": "false",
     "smtpUsername" : "apikey", 
     "smtpPassword" : "yourpassword"
}

 

 

If the comma is there and it's not working, I would give it a try and send the true/false values as booleans instead of strings:

 

{
    "smtpSmartHost": "smtp.sendgrid.net",
     "isClientSecure": true,
     "smtpPort": "587",
     "isAuthEnabled": false,
     "smtpUsername" : "apikey", 
     "smtpPassword" : "yourpassword"
}

 

 

 

Yes, a coma was missing. The SMTP configuration in Unity was updated with 200 OK. However, smtp port is 25 instead of 587 on web GUI. I have to manually change it on Unity.

Maybe like my example with the booleans, try to specify the port as integer instead of a string:

{
    "smtpSmartHost": "smtp.sendgrid.net",
     "isClientSecure": true,
     "smtpPort": 587,
     "isAuthEnabled": false,
     "smtpUsername" : "apikey", 
     "smtpPassword" : "yourpassword"
}

Testing with CUC v14SU3, this seems to work for me:

PUT /vmrest/smtpclient/clientconfigs HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Basic YWRtaW5pc3RyYXRvcjpjaXNjb3BzZHQ=
User-Agent: PostmanRuntime/7.33.0
Host: sjds-cuc14.cisco.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 197
Cookie: JSESSIONID=D8DE29D394C0BF1674BB69B3F5CDD730; JSESSIONIDSSO=1FC7A27E92A64C53DA826137CBDB975F; REQUEST_TOKEN_KEY=-3542186757453495425
 
{
"smtpSmartHost": "smtp.sendgrid.net",
"isClientSecure": true,
"smtpPort": "587",
"isAuthEnabled": false,
"smtpUsername" : "apikey",
"smtpPassword" : "yourpassword"
}
 
HTTP/1.1 200 OK
Cache-Control: private
Set-Cookie: REQUEST_TOKEN_KEY=-3542186757453495425; Path=/; HttpOnly
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000; includeSubdomains
Content-Security-Policy: default-src *; script-src * 'unsafe-inline' 'unsafe-eval';style-src * 'unsafe-inline'; img-src * data: 'unsafe-inline';
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 20 Sep 2023 17:19:48 GMT
Server:
 
<Smtp><message>For change to take effect, restart the Connection SMTP Server service in Cisco Unity Connection Serviceability. If a Connection cluster is configured, restart the service on each server.</message></Smtp>

I do note that the response body here is XML while the Accept/Content-Type are requested/indicated as application/json - it may be more consistent to specify XML.

eric.yang
Level 1
Level 1

Thanks everyone for the help. Everything is good now.