Hello team,
I have a requirement to fetch all the conversations in a queue through API. the queue is a test queue and has not been is use for quite a while. there are 170 interactions waiting which we want to disconnect. However the code is returning only few interactions and if we increase the time duration, it says API can not retrieve data older than 30 days. can you please help.
const platformClient = require('purecloud-platform-client-v2');
const client = platformClient.ApiClient.instance;
// Set environment
client.setEnvironment(<purecloud domain>);
// Login using Client Credentials Grant
client.loginClientCredentialsGrant(Client ID, Client secret)
.then(() => {
// Initialize Analytics API
let apiInstance = new platformClient.AnalyticsApi();
let body = {
interval: "2024-06-01T00:00:00.000Z/2024-06-23T23:59:59.999Z", // Interval for which data is requested
order: "asc",
orderBy: "conversationStart",
paging: {
pageSize: 100,
pageNumber: 1
},
segmentFilters: [
{
type: "and",
predicates: [
{
type: "dimension",
dimension: "queueId",
operator: "matches",
value: "0313b38f-58f5-4fcb-b324-4a66837a9a86"
},
{
type: "dimension",
dimension: "segmentType",
operator: "matches",
value: "interact"
},
{
type: "dimension",
dimension: "purpose",
operator: "matches" ,
value: "acd"
}
]
}
]
};
return apiInstance.postAnalyticsConversationsDetailsQuery(body);
})
.then((data) => {
console.log(`get conversations data success! Data: ${JSON.stringify(data, null, 2)}`);
})
.catch((err) => {
console.log('There was a failure calling postAnalyticsConversationsDetailsQuery');
console.error('Error details:', JSON.stringify(err, null, 2));
});
#Reporting/Analytics------------------------------
Swarup Das
Accenture Solutions Private Limited
------------------------------