AnsweredAssumed Answered

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

Question asked by huy.phan1 on Dec 21, 2016
Latest reply on Dec 22, 2016 by dekwan

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>

Outcomes