8x8 Contact Center Recording Control API

Updated: 03/25/2024

Overview

The 8x8 Recording Control API is an HTTP API that allows tenant to pause and resume the audio feed to your call recording. If you also use Quality Management screen recording the screen recording will be paused during the time the audio is paused.  The typical usage of this API is for CRM triggers to control when to pause and resume call recording during a transaction. Since the API only pauses the audio feed to your recording, there will be silence in the portion of the recording where the pause was initiated.
This document describes the supported parameters for running Recording Control API. Example use cases are provided for reference.
There are three different APIs to control the recording. All these APIs have the same function, but with different parameters and requirements
The first API is authenticated using client cookie along with tenant API action token. Agents with valid 8x8 Agent Workspace session and valid tenant API action token will be able to run the API. The API can only be successfully run on thebrowser window that shares the session as the agent UI. 
If the requirement is to issue the request outside the context of the agent browser session one of the following two appoaches must be used.
The second API is accessed by providing tenantId and agentId. This one is authenticated with basic Auth, which needs tenantId as the username and action token of the tenant as the password. It can be accessed by using curl or postman.
The third API is accessed by providing tenantId and agent email address. The agent email address must be unique in this case to keep the function working. This API is authenticated with basic Auth, which needs tenantId as the username and action token of the tenant as the password. It can be accessed by using curl or postman.
For security reasons, the Recording Control API only accepts requests using HTTPS, so that request headers and response data are encrypted.

API Usage Leveraging the session cookie from agent browser.

The examples in this section WILL ONLY work when issued with the context of the agent session and where the cookie is passed.  If you wish to issue the command from outside this context use the PUT and agentId or agentEmail as described in the following section.
The Recording Control API makes it easy to submit a query, for experimentation, testing or debugging purposes. From a web browser, simply enter the URL. You will be prompted to close the window. In the meantime, the corresponding request will be sent. For example:
https://vcc-na4.8x8.com/AGUI/controlRecording.php?action=pause&token=d3078e5b5817f3a8ad4baf32adc124cf
Will pause the recording of the active line for agent sharing the same session with agent login on the browser.
Revise your query URL based on the login URL of your Tenant. Refer to the Platform URL Guide to retrieve your login URL.

Query Parameters

GET/POST Parameters
The following parameters are allowed to GET or POST parameters passing along with the Control Recording URL. All the parameter data should be URL encoded.
The agents session cookie must accompany the request, if making the request outside the context of the agent session leverage the agentId/email approach in the following section.
Parameter Name Description Accepted Value
action Control action pause or resume
token Authentication token Valid action token generated by Contact Center Configuration Manager for the tenant

Examples

Example 1: The following request pauses the current recording:
https://vcc-na7.8x8.com/AGUI/controlRecording.php?action=pause&token=d3078e5b5817f3a8ad4baf32adc124cf
Example 2: The following request resumes the current recording:
https://vcc-na7.8x8.com/AGUI/controlRecording.php?action=resume&token=d3078e5b5817f3a8ad4baf32adc124cf
Example 3: The following JavaScript code sample shows how to implement a dynamic approach to resume or pause the current recording:
function controlRecording(action) {
        var query = [
            "action=" + action,
            "token=d3078e5b5817f3a8ad4baf32adc124cf"
        ];

        var url = "https://vcc-instance.8x8.com/AGUI/controlRecording.php?" + query.join("&");
        var iframe = document.createElement('iframe');
        iframe.src = url;
        iframe.onload = function () {
            document.body.removeChild(iframe);
        }
        document.body.appendChild(iframe);
    }

    controlRecording("resume"); // or "pause"

API leveraging tenantId and agentId or email to identify agent from any source.

These requests DO NOT require the agent session cookie and can be issued from any source.
In a Linux environment, the curl utility will submit an HTTP request, and allow you to view the result.
curl -X PUT -u {tenantId}:{token} 'https://vcc-sb1.8x8.com/api/tstats/rccontrol/{action}/{tenantId}/agentId/{agentId}'
curl -X PUT -u {tenantId}:{token} 'https://vcc-sb1.8x8.com/api/tstats/rccontrol/{action}/{tenantId}/email/{email}'

Query Parameters

PUT Parameters
Parameter Name Description Accepted Value
action Control action pause or resume
token Authentication token Valid action token generated by Configuration Manager for Contact Center for the tenant
tenantID Tenant Object ID Object ID of target tenant
agentID Agent Object ID Object ID of target agent
email Agent email address Email address of the target agent

Examples

Example 1
The following requests can pause the current recording, either of them can be used to pause:
curl -X PUT -u dev10pedro:00a5c5dd78ba119df8e361288b709e4c2d19ef440c0f2af96d48ead1faa78c9b 'https://vcc-sb1.8x8.com/api/tstats/rccontrol/pause/dev10pedro/agenId/yzhuang'
 curl -X PUT -u dev10pedro:00a5c5dd78ba119df8e361288b709e4c2d19ef440c0f2af96d48ead1faa78c9b 'https://vcc-sb1.8x8.com/api/tstats/rccontrol/pause/dev10pedro/email/yiyang.zhuang@8x8.com'
Example 2
The following requests can resume the current recording, either of them can be used to resume: 
curl -X PUT -u dev10pedro:00a5c5dd78ba119df8e361288b709e4c2d19ef440c0f2af96d48ead1faa78c9b 'https://vcc-sb1.8x8.com/api/tstats/rccontrol/resume/dev10pedro/agenId/yzhuang'
curl -X PUT -u dev10pedro:00a5c5dd78ba119df8e361288b709e4c2d19ef440c0f2af96d48ead1faa78c9b 'https://vcc-sb1.8x8.com/api/tstats/rccontrol/resume/dev10pedro/email/yiyang.zhuang@8x8.com'

Response Codes

Code Number Code Label Description
200 (Status: success) OK The request was successful. Attempt to close browser window for the successful request.
200 (Status: nothing to be modified) OK There is no active transaction when the recording control API is called.
200 (Status: not enabled) OK The recording feature is not enabled for the target agent.
400 Bad request The action type is not known from the request.
401 Unauthorized The request was not allowed, usually due to incorrect authentication or invalid Agent Workspace session.
404 Not found The Agent is not found in the target Tenant.
500 Server Error Internal server error to prevent the request to be completed.

Additional Information

  • There is no return error for any failure of pausing or resuming recordings.
  • There is no support for starting recording from this API. For the transaction that recording has not been started, pause and resume requests will be ignored.
  • The request applies on the active transaction the corresponding agent is currently with.