I am trying to leverage the Bulk delete javascript mentioned in this tutorial:
https://developer.mypurecloud.com/api/tutorials/recordings-bulk-actions/index.html?language=nodejs&step=1
Currently I am just trying to target a conversation during a certain time for a specific user. I have it all working to where I am getting a fulfilled state being returned when checking on the job status. However nothing seems to happen with the recording. I am attempting to set the delete date to october 2019 but its not updating the interaction when I go and actually look at it. I am able to utilize developer tools to simulate my script (using the various job related api calls and the same parameters in my script) and it works perfectly.
This is how my job status looks:
{
id: '2cf53eb4-74ba-402d-aba9-77f70891de36',
state: 'FULFILLED',
recordingJobsQuery: [Object],
dateCreated: '2020-05-15T18:09:49.924Z',
totalConversations: 1,
totalRecordings: 1,
totalProcessedRecordings: 0,
percentProgress: 0,
selfUri: '/api/v2/recording/jobs/2cf53eb4-74ba-402d-aba9-77f70891de36',
user: [Object]
},
The total processed never increments when using the my script. When using developer tools I get this (note this is a different interval):
{
"id": "cc57931e-990e-4865-bc2f-1b41b0732cb1",
"state": "FULFILLED",
"recordingJobsQuery": {
"action": "DELETE",
"actionDate": "2019-10-27T00:00:00Z",
"includeScreenRecordings": true
},
"dateCreated": "2020-05-15T17:16:48.243Z",
"totalConversations": 2,
"totalRecordings": 2,
"totalProcessedRecordings": 2,
"percentProgress": 100,
"selfUri": "/api/v2/recording/jobs/cc57931e-990e-4865-bc2f-1b41b0732cb1",
"user": {
"id": "55463d6e-cc2a-45ef-869b-4ae4da6d4e8a",
"selfUri": "/api/v2/users/55463d6e-cc2a-45ef-869b-4ae4da6d4e8a"
}
I don't see what I could be doing wrong unless the initial job creation is broken in my script and the job is somehow not created properly.
As a test I decided to try and use the script just to create the job, then use developer tools to execute the job. This still fails to work (technically successful with "Fulfilled" state but it doesn't actually set the delete date). I then attempted to create the job and execute with developer tools and it worked perfect.
This is what I am using for the createRecordingBulkJob() function:
return recordingApi.postRecordingJobs({
action: 'DELETE', // set to "EXPORT" for export action
actionDate: '2019-10-27T00:00:00.000Z',
// integrationId: '-- integration id here --', // Only required when action is EXPORT
includeScreenRecordings: true,
conversationQuery: {
interval: '2020-02-28T15:49:00.000Z/2020-02-28T15:59:00.000Z',
segmentFilters:
[
{
type: 'or',
predicates:
[
{
type: 'dimension',
dimension: 'userId',
operator: 'matches',
value: '55463d6e-cc2a-45ef-869b-4ae4da6d4e8a'
}
]
}
],
order: 'asc',
orderBy: 'conversationStart'
}
})
}
And this is how I am using the api in developer tools:
{
"action": "DELETE",
"actionDate": "2019-10-27T00:00:00.000Z",
"includeScreenRecordings": true,
"conversationQuery": {
"interval": "2020-02-28T15:49:00.000Z/2020-02-28T15:59:00.000Z",
"segmentFilters": [
{
"type": "OR",
"predicates": [
{
"type": "dimension",
"dimension": "userId",
"operator": "matches",
"value": "55463d6e-cc2a-45ef-869b-4ae4da6d4e8a"
}
]
}
],
"order": "asc",
"orderBy": "conversationStart"
}
}
I can't seem to figure out what I am doing wrong here. Thanks you in advance for any help!