This is the Node.js API for Altitude Xperience: Outstanding contact center functionality on the cloud at the level of the best on-premise solutions.
##Installation
> npm install --save xperience
##Usage
var xperience = require('xperience')
//create instance
var instance = new xperience.instance()
//connect
instance.connect()
//login
.then(() => instance.login({user:'admin_username',pass:'password',domain:'domain_name'}))
//get campaigns
.then(() => instance.getCampaigns())
.then(cps => console.log(cps))
//fetch a specific recording from a specific service
.then(() => {
var serviceId = 1
var recordingId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
return instance.fetchRecordingByService(serviceId,recordingId)
})
//write recording to file
.then(data => new Promise(resolve => data.body
.pipe(require('fs').createWriteStream('./my_recording.mp3'))
.on('close', () => {
console.log('recording saved to file!');
resolve();
})))
//logout
.then(() => instance.logout())
.catch(err => {
console.log('Something went wrong!', err)
})