07-25-2022 02:25 AM
I'd like to collect user status via finesse API. However, there is 401 http status code when I access "https://uc-pl-finsub.ucm.corp.akamai.com:8445/finesse/api/User/hioka".
The entrypoint was accessed by "NonGadgetPythonSample-Finesse-11.0.1-v1.1".
https://github.com/CiscoDevNet/finesse-sample-code/tree/master/NonGadgetPythonSample
--Updated source code.
<code>
#=========================================================================================
# Step 1
# Change Finesse FQDN and domain to the one you are using
fqdn = "uc-pl-finsub.ucm.corp.akamai.com"
domain = "uc-pl-finsub.ucm.corp.akamai.com"
# Step 2
# Change the Finesse REST API scheme (http or https) and the port (8080, 8082, 8443, 8445)
scheme = "https"
port = "8445"
#port = "8443"
# Step 3
# Change user1 & user2's Finesse user credentials
user1_username = "hioka"
user1_password = "xxxxxxx"
user1_extension = "xxxxxxx"
user2_username = "[FINESSE_USER2_USERNAME]"
user2_password = "[FINESSE_USER2_PASSWORD]"
user2_extension = "[FINESSE_USER2_EXTENSION]"
#=========================================================================================
<code>
-- Result when I execute script.
<code>
hioka@tyo-mpl5y NonGadgetPythonSample-Finesse-11.0.1-v1.1 % python3 finesse.py
GET User - ID: hioka
REST API URL is: 'https://uc-pl-finsub.ucm.corp.akamai.com:8445/finesse/api/User/hioka'
Executing GET 'https://uc-pl-finsub.ucm.corp.akamai.com:8445/finesse/api/User/hioka'
/Users/hioka/Library/Python/3.8/lib/python/site-packages/urllib3/connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host 'uc-pl-finsub.ucm.corp.akamai.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(
GET() - Status: 401
GET() - Text: <!-- custom Cisco error page --><html> <head> <title> Cisco System - null </title> <style type="text/css"> a { color: #316984; text-decoration: none; } a:hover { color: #316984; text-decoration: underline; } a:visted { color: #316984; text-decoration: none; } body { background-attachment: fixed; background-color: #ffffff; background-repeat: no-repeat; color: #316984; font-family: arial,helvetica,sans-serif; } #content { border: 1px solid #d6d7d6; font-size: 93.5%; margin: 0px 10% 30px 10%; } #content-header { background-color: #eeeeee; border-bottom: 1px solid #666666; color: #666666; font-size: 124.5%; padding: 5px 15px 5px 15px; } #copyright { font-size: 75%; margin: 0px 10% 0px 10%; padding: 3px 0px 0px 0px; text-align: right; } img { display: block; margin: 0px 0px 20px 0px; } #logo { margin: 30px 10% 0px 10%; } p { padding: 5px 15px 5px 15px; } pre { padding: 5px 15px 5px 30px; } </style> </head> <body> <div id="logo"> <img src="/ciscologo.gif" alt="Cisco Systems, Inc." /> </div> <div id="content"> <div id="content-header">HTTP Status 401 – </div> <p> <b> type: </b> Status Report </p> <p> <b>Message: </b> </p> <p> <b>Description: </b> http.401 </p> </div> </body></html>
Connecting to the Finesse Notification Service.
<code>
-- Checked FQDN and Port number
Could you please tell me the reason why I see 401 http response code...?
Solved! Go to Solution.
07-25-2022 10:16 PM
I found out the password is wrong. After fixing password, I could get status with 200 response.
07-25-2022 02:45 AM
I've inputed same string userpassword and extension. It might be wrong as a password. How can I check my password on the finesse. I've never used password. Because I user SSO with MFA always. I was wondering if you help me.
07-25-2022 10:16 PM
I found out the password is wrong. After fixing password, I could get status with 200 response.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide