Skip to content

Execute API from WxCC flow.

Objective

In these labs, you'll learn how to execute APIs from a WxCC flow using the native connector and debug the results. The use case involves updating a Global Variable with a default value of 'Open' or 'Closed.' This Global Variable can then be used in other flows, allowing you to implement logic that routes calls to either open or closed-hours greetings.

There are many other use cases that you can implement by using native WxCC API in the flow, such as:

Admin Flows (CCX Delta)

Dynamic Reskilling

Preferred Agent Routing

Dynamic call routing in flow

Journey Data based call routing

Last Agent Routing

CSAT / Rating based Routin

Least Handle Time Agent based Routing

Least Queue Time Queue based Routing

Least Handle Time Queue based Routing

Dynamic Menu Options (Menu from Call Reasons for previous calls from caller)

Personalized Greetings (ANI based personalization using historical information)

Post Call metadata to external system after call gets done (Event Flow)

Task 1. Create a Native connector to execute WxCC APIs from the flow.

Step 1. Login to Control Hub (admin.webex.com). Go to Contact Center and under Integrations find Webex Contact Center connector. Click on Add more.

Nav

Step 2. Fill up the required information and click on Add connector.

Nav

Step 3. You should receive the notification that the connector was created, click to Close the notification.

Nav

Task 2. Create Global Variable.

Step 1. Go to Webex Contact Center Management Portal.

Nav

Step 2. In the Provisioning module search for Global Variables.

Nav

Step 3. Click on Create New Global Variable.

Nav

Step 4. Name the variable "Office_Open_Closed". The variable type set as String. Click on Save.

Nav

Step 5. Copy the Global Variable ID. You will need it in the further tasks.

Nav

Task 3. Create WxCC flow.

Step 1. Go to Control Hub and create a new flow.

Nav

Step 2. Click on Start Fresh.

Nav

Step 3. Provide a name for your flow and click on Create Flow.

Nav

Task 4. Configure flow to executive WxCC API.

Step 1. Add Global Variable to the flow. See the screenshot below with the steps.

Nav

Step 2. Add flow Variable with name Flow_Variable_Open_Closed.

Nav

Step 3. Add Menu node. Configure it with options 1 and 2. Add Google or Native TTS and provide the greeting: "Press 1 to open or 2 to close the office.".

Nav

Step 4. Connect SetVariable node to option 1 of the Menu node and configure it to assign the value "Open" to the flow variable Flow_Variable_Open_Closed.

Nav

Step 5. Add another SetVarialbe node and connect it to option 2 of the Menu node. Configure it to assign value as "Closed" to the flow variable Flow_Variable_Open_Closed.

Nav

Step 6. Add HTTPRequest block and select the connector that you have created in Task 1.

Nav

Step 7. To collect further API requests details, login to the Dev Portal (https://developer.webex-cx.com/) click on Documentation, and on the left side select Global Variables.

Nav

Step 8. On the following window select PUT request.

Nav

Step 9. Click on Try Out and you will see the instructions with the required fields.

Nav

Step 10. Go back to WxCC flow and configure Method PUT and URL with OrgID and Global Variable ID parameters (that you created earlier). For example, if for my test tenant, the OrgID is 80d3ab4e-895c-4a38-9815-4c585100d0b4 and the Globl Variable ID is 23629b1d-802f-4d99-bfc2-811d2fdafd81, then the request URL will be /organization/80d3ab4e-895c-4a38-9815-4c585100d0b4/cad-variable/23629b1d-802f-4d99-bfc2-811d2fdafd81

Nav

Step 11. While on HTTPRequest block scroll down and select the Content Type: Application/JSON.

Then add the body:

{ "active": true, "agentEditable": false, "agentViewable": false, "createdTime": 0, "defaultValue": "{{Flow_Variable_Open_Closed}}", "description": "", "desktopLabel": "", "id": "23629b1d-802f-4d99-bfc2-811d2fdafd81", "lastUpdatedTime": 0, "name": "Office_Open_Closed", "organizationId": "80d3ab4e-895c-4a38-9815-4c585100d0b", "reportable": false, "variableType": "String", "version": 0 }

Please ensure you replace the id, name and organizationId with the one you have for your tenant.

Nav

Step 12. Add DisconnectContact node. Add the flow to your test Channel. Place calls to the number related to your Channel and select 1. The Default Value of the Global variable should change to "Open".

Nav

Place one more call and press option 2, the value should change to "Closed".

Nav

Task 5. Configure flow to see the API call response status code, body and headers.

The HTTPRequest block has 3 Activity Output Variables.

Nav

However, if you run Debugger the values of the variables will be hidden. To see the results of the API call request we need to assign the HttPRequst Activity Output Variables to some flow variables.

Step 1. Create three String-type flow variables with names HTTP_Status_Code, HTTP_Headers, and HTTP_Body.

Nav

Nav

Step 2. Delete the DosconnectContact block and add 3 SetVariable blocks. Connect them one after another and close the flow by adding DisconnectContact node.

Nav

Step 3. Using the SetVariable nodes assign the Activity Output Variables from HTTPRequest node to the Flow Variables that you created in the Step 1.

You can do it by copy the Activity Output Variable name from the HTTPRequest node and use Set Value option in SetVariable node.

Nav

Or you can select the HTTP Activity Output Varialbe from the list using Set To Variable option in SetVariable node.

Nav

Step 4. Publish the flow. Place the test call and check the result in the Debugger.

Nav

Congratulations, you have completed the lab.