question

Upvotes
Accepted
1 0 0 0

Downloading documents via documents API

I am trying to download company research documents via API. For a given document ID, I am trying to use the "https://api.refinitiv.com/data/hvmi/v1/documents/download" endpoint to download the file.


Here is my python script:


import refinitiv.data as rd
rd.open_session()


url='https://api.refinitiv.com/data/hvmi/v1/documents/download/{documentId}'
docid=105077955
request_definition = rd.delivery.endpoint_request.Definition(url=url
                                                             ,method=rd.delivery.endpoint_request.RequestMethod.GET
                                                             ,path_parameters = {"documentId": docid})
response = request_definition.get_data()


Running this, I get a 500 error:


Response(is_success=False, raw=<Response [500 Internal Server Error]>, errors=[Error(code=500, message='')]...


Even when I use the API Playground, I get a "Failed to fetch" error:


1700648456373.png

1700648487719.png

Any ideas?

python#technology#productrefinitiv-data-platform-librariesdocumentendpoint
1700648456373.png (19.8 KiB)
1700648487719.png (18.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @musa.m

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
1.4k 5 3 6

Hi @musa.m

The endpoint that you are referring to is for HVMI documents. I think that in your case it would be https://api.refinitiv.com/data/research/v1/documents/

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.