cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
810
Views
10
Helpful
2
Replies

Unable to collect user status via finesse API due to 401 status code.

hioka
Level 1
Level 1

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

Screen Shot 2022-07-25 at 5.52.58 PM.jpg

Could you please tell me the reason why I see 401 http response code...?

 

1 Accepted Solution

Accepted Solutions

hioka
Level 1
Level 1

I found out the password is wrong. After fixing password, I could get status with 200 response.

View solution in original post

2 Replies 2

hioka
Level 1
Level 1

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.

 

hioka
Level 1
Level 1

I found out the password is wrong. After fixing password, I could get status with 200 response.