From Bright Pattern Documentation
Jump to: navigation, search
• 5.19 • 5.3 • 5.8

Set a Disposition

The setDisposition method can be used with getState to disposition an interaction.

The getState method is used for retrieving agent status and interaction log data. In this example, we are using it to get the item_id (interaction ID), which is, in turn, declared in the setDisposition method. The system needs to know the item_id in order to disposition the correct interaction.

The setDisposition method can be attached to a web element, such as a button, on your webpage. When clicked, the button will process the API method. Add a field to enter the phone number of the third party to be included in the conference.

In this article, you will learn how to:

  • Attach getState and setDisposition buttons
  • Add fields to enter the item_id (interaction ID) and disposition name
  • Place sample JavaScript into HTML

About Dispositions

Dispositions are enabled and configured for each service in the service's Properties tab and Dispositions tab. For a list of configured disposition names and disposition codes, see the Contact Center Administrator Guide.

For more information about how agents use dispositions, see the Agent Guide, section Dispositions and Notes.

Sample Code

This sample code includes methods getState and setDisposition, which are attached to button elements.

Copy this sample code for pasting into your HTML file. This is the bare minimum that you need for the SDK to work. Make sure you replace "<tenant>" with the name of your Agent Desktop web server (e.g., "example.brightpattern.com").

 <iframe id="repeater" style="position:absolute; right: 8px; width: 300px; height: 700px;" src="https://<tenant>.brightpattern.com/agentdesktop/UniversalRepeater.jsp"></iframe>
 
 <button onclick="bpspat.api.getState(log)">Get State</button>
 <br>
 <br>
 <input id="dispositionItem" type="text" placeholder="Item_id"/>
 <input id="dispositionCode" type="text" placeholder="Disposition code"/>
 <button onclick="bpspat.api.setDisposition(document.getElementById('dispositionItem').value, document.getElementById('dispositionCode').value)">Set Disposition By Code</button>
 <br>
 <br>
 <div id="log">Logs...</div>//Logs section.
 <br>
 <br>
 
 <script type="text/javascript">
 window.bpspat.api.init("https://<tenant>.brightpattern.com");
 function log(data) {
 let div = document.createElement("div");
 div.innerHTML = JSON.stringify(data);
 document.getElementById("log").appendChild(div);
 }
 
 </script>

Example Exercise

There are many ways to style your page elements and Agent Desktop widget display. The following is provided for example purposes only.

  1. Paste the sample code into the body of your HTML file.

  2. Save and open the page in your web browser. Make sure the agent is logged in and "Ready."

  3. The call comes in.

    Incoming call


  4. All configured dispositions are selectable from the Active Conversations List. When you use the API to set a disposition, you are bypassing this menu and setting it for the agent.

    List of configured dispositions


  5. During the call, click Get State, which brings up the agent status and interaction log data.

  6. Copy the item_id from the logs and paste it into the Item_ID field. That is needed so the system knows which interaction to disposition.

    The item_id is the interaction ID


  7. During an active interaction or during after-call work, enter the disposition name for the interaction, and click Set Disposition by Name.

    Entering disposition name in item ID field


  8. Alternatively, you can enter the disposition code, and click Set Disposition by Code.

    Entering disposition code field


  9. On the Agent Desktop widget, you can see that the disposition is set.




< Previous