Hmm…I’ve not experienced this - also what’s written above may be a typo but I think what you need is to specify the type you want in the http headers, not URI parameters. Python request.get seems to use “headers” for http headers and not “params” as written above as per https://2.python-requests.org/en/master/user/quickstart/#custom-headers
At least using the http header works for me - and CH say it in the document library documentation. (note “If the Content-Type is unsupported, a 406 error will be generated.”)
I think this should be (note - I’m not a pythonista):
DOCUMENT_API_URL= (exactly what you get from the filing history response links → document metatdata )
REQUEST_HEADERS_FOR_DOC_API = {‘Accept’: ‘application/xhtml+xml’} (or whatever type you want which is listed in the document metadata resource section)
raw_response = requests.get(DOCUMENT_API_URL, auth=(‘YOUR_API_KEY’, ‘’) headers=REQUEST_HEADERS_FOR_DOC_API)
Note I’ve altered this so you’re not using the https://user:password@… syntax - as mentioned e.g. in the URL
wikipedia article this is deprecated (“Use of the format username:password in the userinfo subcomponent is deprecated for security reasons.”). The “auth” part is using a blank password as that’s how CH have organised things.
So - after you’ve checked what formats are actually provided by checking the “resources” section returned by the document metadata endpoint then set your http “Accept” header accordingly. Note - the vast majority of documents are only filed as PDF format (“application/pdf”).
There’s an overview of some of the pitfalls of getting documents here in my comments (I’d rather CH made theirs a bit clearer themselves but hope this helps).