Legacy Dev Forum Posts

 View Only

Sign Up

Downloading All Interaction Recording

  • 1.  Downloading All Interaction Recording

    Posted 06-05-2025 18:16

    cbutler | 2020-02-21 19:41:05 UTC | #1

    Good morning,

    I am currently working on a API to Download all of my Purecloud Interaction Recordings, pretty much all of them since my company signed to Purecloud a few years ago. I am currently trying out a few API's at this point. I am currently using the POST Create Bulk Job for Recordings, most API's keep asking for an integration ID, I am not exactly sure what this is or where I would find it. I am currently using something very close to the code in this Tutorial: https://developer.mypurecloud.com/api/tutorials/recordings-bulk-actions/?language=nodejs&step=3

    I also need to know the Correct URL for the Authorization URL.

    Please let me know as soon as possible.

    Thank you


    tim.smith | 2020-02-21 20:22:18 UTC | #2

    The bulk jobs refer to the AWS S3 recording export process. This is described here: https://help.mypurecloud.com/articles/about-the-aws-s3-recording-bulk-actions-integration/

    If you're not interested in using S3 to host your recordings, you can get download URLs for each recording using POST /api/v2/recording/batchrequests and download them however your app desires.

    cbutler, post:1, topic:7185
    I also need to know the Correct URL for the Authorization URL.

    The authorization flows are documented here: https://developer.mypurecloud.com/api/rest/authorization/. Also note that the SDKs have auth helpers.


    cbutler | 2020-02-26 21:10:34 UTC | #3

    Good afternoon,

    Which Amazon Web Services should I be using, I believe it should be a Amazon RDS with MySQL right? Or is the Database engine up to me?

    Thank you


    anon28885283 | 2020-02-27 00:33:07 UTC | #4

    You just need an S3 bucket


    cbutler | 2020-02-28 19:46:12 UTC | #5

    Good afternoon,

    I am running into an issue with the API Call I trying to run.

    Below is the Error I am receiving

    Parse Error on line 1: const platformClient ^ Expecting 'STRING' , 'NUMBER' , 'NULL' , 'TRUE' , 'FALSE' , '{' , '[' . GOT 'undefined'

    Below is the line where the error is occurring const platformClient = true ('purecloud-platform-client-v2');

    I am not sure what is happeing here.

    Thank you


    tim.smith | 2020-02-28 22:30:25 UTC | #6

    cbutler, post:5, topic:7185
    const platformClient = true ('purecloud-platform-client-v2');

    That's not a valid JavaScript statement. I think you meant require instead of true.


    cbutler | 2020-02-28 22:57:36 UTC | #7

    Good evening,

    I tried that statement, I tried string, true, require. I get the same error message every time. So instead of using an API Client I just put the API into the Code Editor in Purecloud Developer tools, and it is not throwing any error codes or anything now, but when I ran the JS, the Console Output just shows: Line 1: {}. Nothing in my AWS S3 bucket.

    Thanks


    anon28885283 | 2020-03-02 06:12:09 UTC | #8

    Since it seems you've edited the code a few, could you post the entire js script you're trying to run? (Don't include the the client id and secret)


    cbutler | 2020-03-03 16:31:10 UTC | #9

    Good morning,

    I have posted the entire script below, I have removed the IntegrationID and the Client ID and the Client Secret.

    const platformClient = require('purecloud-platform-client-v2')';

    // API Instance const recordingApi = new platformClient.RecordingApi();

    // Global let newJob = null;

    const client = platformClient.ApiClient.instance; client.loginClientCredentialsGrant(username,password) .then(()=> { return createRecordingBulkJob(); }) .then((job) => { console.log('Succesfully created recording bulk job');

    newJob = job; return waitOnJobProcessing(newJob.id); }) .then(() => { console.log('Job is now ready: ' + newJob.id);

    return executeJob(newJob.id); }) .then(() => { console.log('Succesfully execute recording bulk job');

    return recordingApi.exportRecordingJob(newJob.id); }) .then(() => { console.log('Succesfully cancelled recording bulk job');

    return getRecordingJobs(); }) .then((result) => { console.log(result);

    console.log('Succesfully get recording bulk jobs') }) .catch((err) => { console.log(err); });

    function createRecordingBulkJob(){ return recordingApi.postRecordingJobs({ action: 'EXPORT', actionDate: '2020-02-21T20:30:30.ESTZ', integrationId: '____________', //This ID Came from AWS S3 Bucket "grtfinancial" Access Control List includeScreenRecordings: true, conversationQuery: { interval: '2019-01-01T01:00:00.ESTZ/2019-01-03T01:00:00.ESTZ', order: 'asc', orderBy: 'conversationStart' } }) }

    function waitOnJobProcessing(id){ // Initial state of job is PROCESSING // Wait every 2sec until job has READY state return new Promise((resolve, reject) => { let timer = setInterval(() => { recordingApi.getRecordingJob(id) .then((jobStatus) => { console.log(State is ${jobStatus.state}.) if(jobStatus.state == 'READY') { resolve(); clearInterval(timer); } }) .catch((e) => reject(e)); }, 2000); }); }

    function executeJob(id){ return recordingApi.putRecordingJob(id, { state: 'PROCESSING' }); }

    function getRecordingJobs(){ return recordingApi.getRecordingJobs({ pageeSize: 500, pageNumber: 1, sortBy: 'dateCreated', state: 'READY', // valid values FULFILLED, PENDING, READY, PROCESSING, CANCELLED, FAILED showOnlyMyJobs: true, jobType: 'EXPORT' // or 'DELETE' }) }

    Thank you


    anon28885283 | 2020-03-04 03:57:27 UTC | #10

    If you used this code in the Code Explorer it won't work since client Credentials Grant is not supported in browser. Not to mention there are some syntax errors in your code.

    For now I can refer you to a webinar we hosted about download recordings (30 minutes). It discusses setting up the bulk actions for S3 and running the code in sample code.

    https://genesys.zoom.us/webinar/register/2415813882970/WN_JuPdD-MYSQ64Qsg9wc_5IQ


    cbutler | 2020-03-13 18:54:20 UTC | #11

    Good evening,

    I actually ended up correcting the issues, at least most of the issues, in the previous code. I actually ended up watching that Dev Cast quite a few times now, and it was a huge help thank you for your insight into that. The script seems to be working but when I run it, this the the result I get back

    { entities: [], pageSize: 25, pageNumber: 1, total: 0, firstUri: '/api/v2/recording/jobs?pageSize=25&pageNumber=1&sortBy=dateCreated&state=READY&jobType=EXPORT&showOnlyMyJobs=true', selfUri: '/api/v2/recording/jobs?pageSize=25&pageNumber=1&sortBy=dateCreated&state=READY&jobType=EXPORT&showOnlyMyJobs=true', lastUri: '/api/v2/recording/jobs?pageSize=25&pageNumber=1&sortBy=dateCreated&state=READY&jobType=EXPORT&showOnlyMyJobs=true', pageCount: 0 }

    but when I actually go to my AWS S3 Bucket, there is nothing there. I seen in your Dev Cast you actually cancelled the job, so I ended up getting rid of that line. It also may have something to do with the configuration of the S3 Bucket, I did not set up the S3 bucket. Do you have any insight on what the configuration should look like on the AWS S3 bucket?

    Thank you,


    anon28885283 | 2020-03-16 12:07:49 UTC | #12

    Hi, as far as the AWS/S3 configuration go, then the PureCloud Resource Article details everything that needs to be set up. The reason you're getting no result from the last call was that the query is looking for jobs with READY state.

    ...&state=READY...

    if you have successfully executed a job then it should have the state FULFILLED. Take note also that it can still take up to 24 hours before the actual recordings will show up in the S3 bucket.


    cbutler | 2020-03-19 15:04:16 UTC | #13

    Good morning,

    I apologize for the delay, we have been extremely busy here with the whole situation here, but I was just about to update the API and run it, but I figured I should check the S3 bucket and all of the recording were actually in there, so the API is actually working. I appreciate all the help you have provided, thank you so much. I do have a question for you though, I started to listen to some of the recordings that were exported, and they do not sound right. It's kind of hard to explain what we are hearing, almost like a fax machine but not, there is no words just random noises.

    Please let me know if you know what is happening.

    Thank you


    anon28885283 | 2020-03-23 01:50:42 UTC | #14

    Are you able to check in PureCloud if the recordings for those specific conversations sound the same?

    If you think there are issues with the recordings themselves please open a case with PureCloud Care to investigate.


    system | 2020-04-23 01:50:44 UTC | #15

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 7185