cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1430
Views
3
Helpful
2
Replies

Finesse API Error Format

As per the finesse developer guide:

[quote]

Each error includes a failure response, error type, error message, and error data. The following is an example

of a failure message format:

<ApiErrors>

<ApiError>

<ErrorType>Authentication Failure</ErrorType>

<ErrorMessage>UNAUTHORIZED</ErrorMessage>

<ErrorData>jsmith</ErrorData>

</ApiError>

</ApiErrors>

[/quote]

However, we are getting API error as HTML and not in above described format.

For example, When we do GET Method on USER URI by providing incorrect authorization we are getting this on error stream:

<!-- custom Cisco error page --><html>    <head>        <title>            Cisco System - Error report        </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> This request requires HTTP authentication ().            </p>        </div>    </body></html>

2 Replies 2

golmsted
Level 4
Level 4

There are two different levels of errors. And which you will get depends on how far you get into the application:

1) First and foremost, Cisco Tomcat itself will return errors like 401, 404, 500 when you are doing something (or something is wrong) that doesn't allow you to reach all the way to the API itself

2) Once you can actually hit the API you will get typically a 400 with an error like you described.

Sometimes, when using an Agent Desktop

API you will get a 202, but an error in that format will bubble up the XMPP channel.

My recommendation is to first check the HTTP Status (200, 202, 400, 401, 500). 401 always means UNAUTHORIZED (in some way).

Good Luck!

g.

Thanks Gary.

Appreciate your response on this.

I understand that we may not always get Error in the described API-ERROR format and we could have some 4xx errors reported with different body. However I would still expect the errors to be reported synchronously but if some of these errors are reported on XMPP Connection after successful response to the request it becomes very difficult for third party applications to integrate with finesse APIs.

Here is what we tried, we sent answer requestAction via dialog-api for the dialog which was already answered . I was expecting to see some 4xx error in this case, however web request returned with response code 202 without any response/error body and Error-Message was then sent separately over XMPP Connection. If an application that invokes some of these finesse api's in succession ( back to back), then it becomes very hard to know which of them really failed as there is no way to tie up the request over HTTP connection with error-message over XMPP Connection.