5 Replies Latest reply: Dec 12, 2017 1:12 PM by dekwan RSS

Update wrap-up data via REST API

marklind@axis.com

Hi,

 

I know how to get the wrap-up reason code list with the following URI:

https://<FQDN>/finesse/api/User/<id>/WrapUpReasons


But I don't know how I would be able to update the wrap-up data during a call via the REST API, is it possible? Could it be related to "Update Call Variable Data" (Dialog—Update Call Variable Data)?


I have read the following document https://developer.cisco.com/fileMedia/download/90f66367-13f0-41a9-aadd-84df32057afe

Best regards,

Markus Lindberg

  • 1. Re: Update wrap-up data via REST API
    dekwan

    Hi Markus,

     

    Yes, you can update the wrap up reason during the call with the Update Call Variable Data REST API. You need to populate the wrap up reason in this field here: <wrapUpReason>Happy customer!</wrapUpReason>

     

    Thanx,

    Denise

  • 2. Re: Update wrap-up data via REST API
    marklind@axis.com

    Hi,

     

    Thank you for your answer.

    Is the dialog id unique for every call and you have to use it for the Update Call Variable Data REST API call?

     

    Best regards,
    Markus

  • 3. Re: Update wrap-up data via REST API
    dekwan

    Hi,

     

    Yes, the dialogId is unique for every call. For the most part, they map to the callId from CCE/X. And yes, you need to use it for the Update Call Variable Data REST API request because you are updating the wrap up for that particular call.

     

    Thanx,

    Denise

  • 4. Re: Update wrap-up data via REST API
    joycentiong

    Hi Denise,

     

    Currently, I am updating CallVariables using finesseext.js provided by Cisco as shown below:

     


    finesse.restservices.Dialog.prototype.updateCallVariable =  function (name, value, options)
        {
            this.isLoaded();
       
      var callvar = {
                        "name" : name,
                        "value" : value

      };
      var callvariable = { "CallVariable" : callvar };


     
        
            var mediaProperties =
            {
                "callvariables":  callvariable

            };

            options = options || {};
            options.content = {};
            options.content[this.getRestType()] =
            {
                "mediaProperties": mediaProperties,
               // "requestedAction": finesse.restservices.Dialog.Actions.UPDATE_CALL_DATA
         "requestedAction": "UPDATE_CALL_DATA"
            };
            options.method = "PUT";
            this.restRequest(this.getRestUrl(), options);

            return this;
        };

     

     

     

     

    It is working for Updating Call variables. Now I am trying to use the same function to update WrapUp data. Can I still use the same function above?

  • 5. Re: Update wrap-up data via REST API
    dekwan

    Hi Danny,

     

    Yes, except it would be for "wrapUpReason" instead of "callvariables" to match the XML for the request body (see below).

     

    Example REST request body:

    <Dialog>
      <requestedAction>UPDATE_CALL_DATA</requestedAction>
      <mediaProperties>
      <wrapUpReason>Happy customer!</wrapUpReason>
      <callvariables>
       <CallVariable>
        <name>callVariable1</name>
        <value>123456789</value>
       </CallVariable>
       <CallVariable>
       ... Other call variables to be modified ...
       </CallVariable>
      </callvariables>
      </mediaProperties>
    </Dialog>


    Thanx,

    Denise