Getting in your FACE: The Interactive Session Recorder API
Toby Allen
Solving your customer identity challenges with Auth0 - Senior Solutions Engineer | CISSP | CCSP
This week I've been playing around a little more with Oracle's Interactive Session Recorder specifically I've been digging into all the things the FACE API can do in ISR 6.0 the new release. FACE which stands for "Feature for the Aggregation and Control of Events" (I think they brainstormed that for a while) is a seperate server deployed into an ISR solution that acts as the agregration point for all programmatic access of call recordings. It hosts a full REST API interface for the ISR allowing full recording control (start, stop, pause), recording retrieval and metadata access.
ASIDE: If you're not familiar with the ISR it is a highly scalable low cost call recording platform with a wealth of programatic interfaces allowing call recording to be started and stopped on demand and faciliating integration with all manner of analytics and business systems. For more information hit the link above or watch the video below.
This exploration is by no means meant to be exhaustive but I'll first retrieve a list of calls and then update some custom metadata fields. First step is to login and retrieve your access token. The below node snippet will dump the token for the specified user to the console. Make sure you setup your requirements first as well I'm using request-promise in this instance to perform the queries.
var querystring = require('querystring');
var rp = require('request-promise');
var query = querystring.stringify({
'userEmail': USER,
'password': PASSWORD
});
console.log(query);
var options = {
url: DOMAIN+'/Face/login',
body: query,
method: 'post'
};
rp(options)
.then(function (body) {
console.log(body);
parseString(body, function (err, result) {
console.log(result);
});
})
.catch(function (err) {
// API call failed...
console.log('error:', err); // Print the error if one occurred
});
Retrieving and dumping the list of calls is as simple as a performing a GET request with the token. You can narrow it down to a specific user, number, agentID etc. by also specifiying this in your query string. The below grabs the list of calls and dumps the first one out to the console.
options = {
url: DOMAIN+'/Face/audioRecording/details',
rejectUnauthorized: false,
json: true,
qs: {
'token': API_KEY
}
};
rp(options)
.then(function (body) {
result = body.result;
console.log(result.message);
matches = result.matches;
call = matches[0].match;
console.log(call);
})
.catch(function (err) {
// API call failed...
console.log('error:', err); // Print the error if one occurred
});
Retrieving a specific call is as simple as specifying the "recordingID" in the query string. So just change the query options as below.
options = {
url: DOMAIN+'/Face/audioRecording/details',
rejectUnauthorized: false,
json: true,
qs: {
'token': API_KEY,
'recordingId': call.recordingId
}
};
Now, writing the metadata is a little more involved. The first step is to head into the Admin area on the ISR dashboard and make sure that you have defined the names of the custom fields that you're interested in. Then you need to perform a POST request with the querystring identifying the specific call you want (like above) and with the body of the request containing the name of the field(s) you want to update and the values you want to insert. The below snippet sets the options for request-promise including to return the result as a JSON object and then dumps it to console. Here I am updating the custom field "AvayaAgentID" with the value "customDataValue1". Note you need to explicitly parse the returned result as JSON.
//Update Details on a call
query = querystring.stringify({
'AvayaAgentID': 'customDataValue1'
});
options = {
url: DOMAIN+DETAILS,
rejectUnauthorized: false,
qs: {
'token': API_KEY,
'recordingId': call.recordingId
},
headers: {
'Accept': 'application/json'
},
body: query,
method: 'post'
};
rp(options)
.then(function (body) {
console.log(body);
recording = JSON.parse(body).result.recording;
console.log(recording);
console.log(recording.customDataSets);
console.log(recording.siprecDataSets);
console.log(recording.dtmfDigits);
})
.catch(function (err) {
// API call failed...
console.log('error:', err); // Print the error if one occurred
});
This was just a short update today which I hope you have found interesting. As always if you have any questions feel free to reach out.
PS: If you found this interesting you may also find my post from a couple of weeks ago, "Localizing Interactive Session Recorder Dashboard with Watson Language Translator" worth a read.
Views are my own and do not necessarily reflect those of Oracle.