Contact list download URI missing [Content-Disposition] header

Contact list from Genesys is being downloaded daily basis with following sequence of operation as csv file.

code language : Python

  1. To get the URI of contact list, we use following API (in python language)

api_instance.get_outbound_contactlist_export(contactlist_id, download=False)

  1. Once we get URI , it make simple get request to that URI with bearer token in request header.

request_headers= {'authorization': f'bearer {token}'}

response = requests.get(URI_of_contactlist, headers=request_headers)

  1. The response.content is the CSV content that is saved locally with file name that is derived from contactlist id & name retrieved from 'Content-Disposition' header of response

file_name=get_filename_from_cd_header(response.headers['Content-Disposition'])

write_to_bucket(bucketFolder, file_name,,response.content,"text/csv",storageClient)

here , we want to know on the response of get request to URI to download CSV will have 'Content-Disposition' header or not going forward.

This is used to decide the file name on which contact list is saved. (i.e. RFC 6266 - Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP) )

Hi @Urvish

You are missing a step during the export process. The uri in the response from GET /api/v2/outbound/contactlists/{contactListId}/export contains the download ID i.e. "https://api.mypurecloud.com/api/v2/downloads/<download ID>"

You then need to use that ID in a call to GET /api/v2/downloads/{downloadId} to get the real url that you can use to download the CSV file. (you may need to set the query parameter issueRedirect to false)

Hope this helps
Charlie

Thank you for reply.
I have implemented this since day 1 and currently also I m able to download the CSV file without any issue. (i.e making request to https://api.mypurecloud.com/api/v2/downloads/ url)

Only observation is that aft 12-Jun night, response to download CSV file is missing [Content-Disposition] header.

U mean even it is working, it need to change ?

This was not an announced change, nor is that header behavior documented that I'm aware of. Please open a case with Genesys Cloud Care if you feel that this is a bug.

thank u I will check cloud care.

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