Legacy Dev Forum Posts

 View Only

Sign Up

PureCloud API batch download conversations to S3 issue

  • 1.  PureCloud API batch download conversations to S3 issue

    Posted 06-05-2025 18:16

    matt.gabrielson1 | 2020-04-08 13:56:42 UTC | #1

    We followed the bulk download instructions and although the job shows ‘Fulfilled’ with records, there are no conversation files. It seems to be part of a “Cross region bucket validation”. My bucket is in US West (Oregon) region, I have also tried with US East (N. Virginia) region.

    Could you please review and suggest what may be possible reasons of job not posting to S3 bucket? Can you point us in the right direction?

    Followed this KB /articles/about-the-aws-s3-recording-bulk-actions-integration/ Job goes to Fulfilled state, but no recordings are uploaded to our S3 bucket.

    I have done the steps from the documentation:

    • My PureCloud user has ‘integrations::’ permission.
    • Created S3 bucket, policy in AWS and role by this instructions: /articles/create-iam-resources-for-aws-s3-bucket/.
    • Added the AWS S3 recording bulk actions integration by this instructions: /articles/add-the-aws-s3-recording-bulk-actions-integration/. With previously created AWS Role.
    • Executed the code (attached to the letter, was done by this instructions: /api/tutorials/recordings-bulk-actions/index.html except cancelling) to create export job in PureCloud.

    (No policy in PureCloud was created: /articles/create-recording-policy/. Is my understanding correct: it is only for after integration actions – like after each chat post recording to AWS S3, but it is not for exporting of last several months for instance ?).

    Job was successful and said it had 152227 recordings. It went to Fulfilled state, but no recordings are uploaded to our S3 bucket.

    After turning off/on the integration in PureCloud I see the following error: Integration failed validation: Cross region bucket validation failed.

    We would like to export to S3 only, without deleting recordings. Deletion is not intended in this action, just download. Could you please confirm or correct my assumptions below:

    1. Policy in PC (/articles/create-recording-policy/) is needed for every time runtime actions. For example, to export to AWS S3 right after integration every time integration is finished, or remove each interaction recording after 3 month. So in my understanding it is not needed to create a PC policy for one time exporting of historical data. Therefore I had not created any policies in PC account. Is it correct? If not, what settings should I set in a policy to enable my job for one time exporting to AWS S3 without deleting recordings?
    2. There are two types of jobs: DELETE and EXPORT (this is what is also available in RecordingJobsQuery.ActionEnum of PureCloudPlatform.Client.V2 C# package). In the example available on PC website (/api/tutorials/recordings-bulk-actions/index.html?language=nodejs&step=3) DELETE is used (in my understanding it will create all the recording in the interval specified). I am creating a job with EXPORT action type:

    var body = new RecordingJobsQuery(RecordingJobsQuery.ActionEnum.Export, DateTime.Now, integrationId, false, new AsyncConversationQuery("2020-01-01T00:00:00.000Z/2020-03-01T00:00:00.000Z"));

    When job is in Ready state I send it for processing:

    var jobStatus = await recordingApi.GetRecordingJobAsync(job.Id);

    while (jobStatus.State != RecordingJob.StateEnum.Ready)

    {

    jobStatus = await recordingApi.GetRecordingJobAsync(job.Id);

    }

    var jobResult = await recordingApi.PutRecordingJobAsync(job.Id, new ExecuteRecordingJobsQuery(ExecuteRecordingJobsQuery.StateEnum.Processing));

    These are the only options performed. I expect it to perform only export to S3 without deleting recordings when job is Fulfilled. (Considering that other steps except policy were done: /articles/about-the-aws-s3-recording-bulk-actions-integration/)

    Is this process valid and correct to meet my expectations?

    Looking forward to hearing from you!


    tim.smith | 2020-04-08 16:12:24 UTC | #2

    matt.gabrielson1, post:1, topic:7510
    After turning off/on the integration in PureCloud I see the following error: Integration failed validation: Cross region bucket validation failed.

    Note that the integration requirements require "An AWS S3 bucket in the same region as your PureCloud organization". If your org is in us-east-1, the bucket must be also. If you're getting this error when using a bucket in the same region, please open a case with Genesys Cloud Care for further investigation; the job being in the state of fulfilled without fulfilling the request doesn't sound correct.


    Amira | 2020-04-13 12:29:08 UTC | #3

    Hi Tim!

    Thank you for your reply. Yes, we figured out and fixed the issue with bucket validation. It was due to not immediate settings update.

    However we still have an issue with the bucket being empty. The file with "This object created to validate activation of PureCloud integration" was created in the bucket. The job was executed and went to FULFILLED state: { id: 'bb95723a-40d8-44e7-8c16-299c3e936f39', state: 'FULFILLED', recordingJobsQuery: [Object], dateCreated: '2020-04-09T09:28:42.101Z', totalConversations: 289554, totalRecordings: 245240, totalProcessedRecordings: 0, percentProgress: 0, selfUri: '/api/v2/recording/jobs/bb95723a-40d8-44e7-8c16-299c3e936f39', user: [Object] } But it processed 0 recordings and bucket is empty.

    The job was created with the code: return recordingApi.postRecordingJobs({ action: 'EXPORT', actionDate: '2029-01-01T00:00:00.000Z', integrationId: integrationId, includeScreenRecordings: false, conversationQuery: { interval: '2020-01-01T00:00:00.000Z/2020-03-01T00:00:00.000Z', order: 'asc', orderBy: 'conversationStart' } })

    We need to export to S3 bucket without deleting recordings.

    The code was taken from : https://developer.mypurecloud.com/api/tutorials/recordings-bulk-actions/index.html?language=nodejs&step=6 Job action was changed from DELETE to EXPORT.

    Could you please describe the possible reasons and steps we should take to fix it or debug?

    Looking forward to hearing from you.

    Best regards, Amira


    anon28885283 | 2020-04-14 00:03:49 UTC | #4

    Hi Amira,

    After executing a job, it will wait until the actionDate to actually perform the action. Please change the actionDate to the current date/time or even past one to start the export to S3.

    Once that job is fulfilled it can take up to 24 hours for the recordings to show in your S3.


    Amira | 2020-04-14 10:06:16 UTC | #5

    Hi,

    Thank you for the information! OK, it make sense.

    However, I had run several jobs before the one above using c# code and there I have specified DateTime.Now:

    var body = new RecordingJobsQuery(RecordingJobsQuery.ActionEnum.Export, DateTime.Now, integrationId, false, new AsyncConversationQuery("2020-01-01T00:00:00.000Z/2020-03-01T00:00:00.000Z"));

    The result was the same: job went to FULFILLED but my bucket is empty.

    Then I took the exact code in NodeJS from: https://developer.mypurecloud.com/api/tutorials/recordings-bulk-actions/index.html?language=nodejs&step=3 and changed DELETE to EXPORT.

    After your reply I have changed the date to the date in the past but recordings were not uploaded to S3. Here is my job:

    { id: '6b28f7a6-6cce-4d6c-82a1-23b01fd03eb0', state: 'FULFILLED', recordingJobsQuery: [Object], dateCreated: '2020-04-14T06:03:05.298Z', totalConversations: 418910, totalRecordings: 360023, totalProcessedRecordings: 0, percentProgress: 0, selfUri: '/api/v2/recording/jobs/6b28f7a6-6cce-4d6c-82a1-23b01fd03eb0', user: [Object] }

    Created with the following function:

    function createRecordingBulkJob(){ return recordingApi.postRecordingJobs({ action: 'EXPORT', actionDate: '2020-01-01T00:00:00.000Z', integrationId: integrationId, includeScreenRecordings: false, conversationQuery: { interval: '2020-01-01T00:00:00.000Z/2020-04-01T00:00:00.000Z', order: 'asc', orderBy: 'conversationStart' } }) }

    I have received another reply some time ago that said:

    Looking at the logging for this, are you trying to do export and delete? I'm seeing warnings in our logs about export dates and delete dates and permission failures for your OAuth client trying to update recording policies. I checked the OAuth client's permissions and it doesn't have policy permissions (which is how we flag the recordings to be deleted). If you used our example then it is trying to flag those recordings to be deleted after exporting and failing that step, thus nothing is done. You can add these permissions to the client and it will succeed this time. If not, please let us know the resulting job or correlation IDs so that we may investigate further.

    But I do need an insight on what is causing deletion. What is flagging them for deletion? I do not want to delete, I need to export only with no effect on recordings. The recordings must remain. The job is EXPORT, I do not create DELETE job. Or is it in the settings?

    Could you please confirm or correct my assumptions below:

    1. Policy in PC (https://help.mypurecloud.com/articles/create-recording-policy/) is needed for every time runtime actions. For example, to export to AWS S3 right after integration every time integration is finished, or remove each interaction recording after 3 month. So in my understanding it is not needed to create a PC policy for one time exporting of historical data. Therefore I had not created any policies in PC account. Is it correct? If not, what settings should I set in a policy to enable my job for one time exporting to AWS S3 without deleting recordings?
    2. There are two types of jobs: DELETE and EXPORT. And EXPORT job will not trigger delete in any case. Is it correct?

    Could you please help me with it?

    Looking forward to hearing from you! Best regards, Amira


    anon28885283 | 2020-04-15 00:52:04 UTC | #6

    Hi Amira, to answer your questions:

    1. That's right, Policies are used for automated export/deletion based on conditions set on the policy. When using the API to execute the export integration, a policy is not needed.
    2. Yes, EXPORT action should not trigger the DELETE action and vice versa.

    I rechecked the response you were getting and there's 0 totalProcessedRecordings which is not the expected case since it should be processed before the state goes to FULFILLED. For this please open a case with care or continue working with them so they can investigate the issue further.


    system | 2020-05-16 00:52:05 UTC | #7

    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: 7510