cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2160
Views
5
Helpful
3
Replies

Cisco Finesse Rest API not allowing changing agent state to not-ready with reason Code

huy.phan1
Level 1
Level 1

Using Chrome Postman to test the Finesse REST API.

I ran a GET command to retrieve the list of available NOT-READY reason codes for the agent and received the following response.

http://my.finesse.server/finesse/api/User/cons8510/ReasonCodes?category=NOT_READY

esponse from Finesse

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ReasonCodes category="NOT_READY">

    <ReasonCode>

        <uri>/finesse/api/ReasonCode/1</uri>

        <category>NOT_READY</category>

        <code>71</code>

        <label>LUNCH</label>

        <forAll>false</forAll>

    </ReasonCode>

    <ReasonCode>

        <uri>/finesse/api/ReasonCode/2</uri>

        <category>NOT_READY</category>

        <code>72</code>

        <label>IN MEETING</label>

        <forAll>false</forAll>

    </ReasonCode>

    <ReasonCode>

        <uri>/finesse/api/ReasonCode/3</uri>

        <category>NOT_READY</category>

        <code>73</code>

        <label>TRAINING</label>

        <forAll>false</forAll>

    </ReasonCode>

</ReasonCodes>

So I went into a ready mode using a PUT command from Postman

<User><state>READY</state></User>

the agent went into ready state and received a status 202 Accepted status

So now I attempt to put the agent into a NOT_READY state with reason code 71

<User><state>NOT_READY</state><reasonCodeId>71<reasonCodeId></User>

I'm getting a status 400 Bad Request with the following API error

<ApiErrors>

    <ApiError>

        <ErrorType>Invalid Input</ErrorType>

        <ErrorData>finesse.api.reasoncode.not_valid</ErrorData>

        <ErrorMessage>The Reason Code specified in the request does not exist</ErrorMessage>

    </ApiError>

</ApiErrors>

So I try to go into NOT_READY without reason code

<User><state>NOT_READY</state></User>

I'm getting a status 400 Bad Request with the following API error

<ApiErrors>

    <ApiError>

        <ErrorType>Parameter Missing</ErrorType>

        <ErrorData>finesse.api.reasoncode.require_reasoncode</ErrorData>

        <ErrorMessage>The state change requires a valid reason code.</ErrorMessage>

    </ApiError>

</ApiErrors>

1 Accepted Solution

Accepted Solutions

dekwan
Cisco Employee
Cisco Employee

Hi,

I moved this question to the Finesse forum because it fits better here. When changing the reason code for NOT_READY, you have to use the reason code ID, not the reason code.

<ReasonCode>

        <uri>/finesse/api/ReasonCode/1</uri>

        <category>NOT_READY</category>

        <code>71</code>

        <label>LUNCH</label>

        <forAll>false</forAll>

    </ReasonCode>

So for this one, you need to use 1, not 71.

Thanx,

Denise

View solution in original post

3 Replies 3

dekwan
Cisco Employee
Cisco Employee

Hi,

I moved this question to the Finesse forum because it fits better here. When changing the reason code for NOT_READY, you have to use the reason code ID, not the reason code.

<ReasonCode>

        <uri>/finesse/api/ReasonCode/1</uri>

        <category>NOT_READY</category>

        <code>71</code>

        <label>LUNCH</label>

        <forAll>false</forAll>

    </ReasonCode>

So for this one, you need to use 1, not 71.

Thanx,

Denise

steinbrunnerj
Level 1
Level 1

Hi,

I also figured out the same problem and asked myself, if this is maybe a not very good way of implementation.

When parsing XML files it would be good, if there would be a specific tag (e.g. db_code_id) for the database ID of the reason code which is required to set a agent status by using the REST API.

Or if there would be a possibility to change the database ID of a reason code to the reason code id, this would also solve the problem.

Does anyone know if there will be a change in one of the next releases regarding this topic?

Best regards,

Jörg

Hi Jörg,

I don't quite understand how a database id would make a difference. Currently, Finesse has a reason code id (1 in the above example) and a reason code number (71 in the above example). The reason code id is required to sest a agent state using the REST API, so isn't this the same thing as using the database id?

I am not aware of any plans to change the design for the reason codes and reason code ids in the next releases.

Thanx,

Denise