05-07-2019 05:54 AM
Hi ,
As mentioned in the title I am trying to use this gadget to update the Wrap Up Reason for agent initiated Outbound calls. I have found the information below and am using it as a guide.
<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> </callvariables> </mediaProperties> </Dialog>
I have modified the sample code as below (in bold) but it does not appear to be updating the Wrap Up Reason for inbound or outbound calls.
// Build the content body
var contentBody = {
"Dialog" : {
"requestedAction": finesse.restservices.Dialog.Actions.UPDATE_CALL_DATA,
"mediaProperties": {
"wrapUpReason": {value}
"callvariables": {
"CallVariable": {
"name": name,
"value": value
}
}
}
}
};
I have tried various version of the syntax including a static string but nothing seems to work. Thanks for reading.
Solved! Go to Solution.
05-13-2019 11:02 AM
Hi,
For the updateWrapUpReason, it needs to be called against the dialog object. So using the Update Call Variable Data Sample Gadget code, that would be currentDialog.updateWrapUpReason(...).
In your code earlier, you had
"wrapUpReason": {value}
Are you actually putting the brackets in the code? If so, that is probably what is breaking your gadget. I was assuming that you were just doing that syntax to say that you are putting the actual value. The syntax should be:
"mediaProperties": {
"wrapUpReason": wrapUpValue,
"callvariables": {
"CallVariable": {
"name": name,
"value": value
}
}
}
Thanx,
Denise
05-07-2019 09:20 AM
Hi,
The syntax that you show seems right, but there is actually an easier way. The Finesse JavaScript library has a method to update the wrap up reason and you can use that directly: https://pubhub.devnetcloud.com/media/finesse/docs/guides/javascript-library/symbols/finesse.restservices.Dialog.html#updateWrapUpReason
updateWrapUpReason(wrapUpReason, handlers)
Update this dialog's wrap-up reason.
Parameters: {String} wrapUpReason The new wrap-up reason for this dialog {finesse.interfaces.RequestHandlers} handlers An object containing the handlers for the request
Also, double check that you can update the wrap up reason at that time of the call. You can easily check by using the API directly via Postman.
Thanx,
Denise
05-13-2019 10:16 AM - edited 05-13-2019 10:19 AM
Thanks Denise,
I am going to have to read up on how to use the Finesse JavaScript library as I get "updateWrapUpReason is undefined" when I try to use it in the Update Call Variable Data Sample Gadget.
I am mystified as to why the original sample code does not work with my "wrapUpReason": {value} modification. In fact it seems to break the gadget completely and I don't even get the default html message that is displayed when no call is active.
"Please wait for a call to arrive. (UPDATE_CALL_DATA must be an allowable action for the user)"
Best Reagrds
Boyd
05-13-2019 11:02 AM
Hi,
For the updateWrapUpReason, it needs to be called against the dialog object. So using the Update Call Variable Data Sample Gadget code, that would be currentDialog.updateWrapUpReason(...).
In your code earlier, you had
"wrapUpReason": {value}
Are you actually putting the brackets in the code? If so, that is probably what is breaking your gadget. I was assuming that you were just doing that syntax to say that you are putting the actual value. The syntax should be:
"mediaProperties": {
"wrapUpReason": wrapUpValue,
"callvariables": {
"CallVariable": {
"name": name,
"value": value
}
}
}
Thanx,
Denise
05-13-2019 01:18 PM
Hi Denise,
You are right it was the brackets. It's working now and I can set the Wrap Up Reason on Outbound calls to meet the customer requirements.
Thanks again for your help.
Best Regards
Boyd
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide