09-18-2023 03:08 PM
Hi there,
I tried to update smtp configuration by using Postman but failed with error 400 Bad Request. Is there anything wrong?
Thanks.
Solved! Go to Solution.
09-19-2023 11:48 PM - edited 09-20-2023 12:19 AM
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"
}
09-18-2023 11:25 PM
@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.
09-19-2023 11:25 AM
I did not find where is the DevNet forum, could you please post the link here? Thanks
09-20-2023 12:03 AM
09-18-2023 11:54 PM
Hi eric, what product/API?
09-19-2023 10:34 AM
It appears that SMTP client management support appears only as of CUC v14SU2 - are you perhaps using an earlier version?
09-19-2023 11:26 AM
Unity Connection v14SU3
09-19-2023 11:48 PM - edited 09-20-2023 12:19 AM
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"
}
09-20-2023 07:57 AM
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.
09-20-2023 08:10 AM
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"
}
09-20-2023 10:24 AM
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.
09-21-2023 12:24 PM
Thanks everyone for the help. Everything is good now.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: