For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
6 0 2 4

DSS Python Shareholder Rights Example Application

I downloaded below sample file.

https://developers.refinitiv.com/en/api-catalog/datascope-select/datascope-select-rest-api/download

Python Shareholder Rights Example Application

Updated on 5 Jan 2018.

dss-python-shareholder-r...mple.zip

562.98KB • 11 Sep 2020


When I run on VSC, it returns below error mgs under line 308.

Can you advise me what needs to be modified?

--------------------------------------------------------------------------------------------------------

PS C:\Temp\DSS\dss-python-shareholder-rights-sample> python fetchDSSshareHolderData.py

currDTstr=20210209164026

INFO, 20210209164026, Start time

INFO, 20210209164027, Successfully created token (STEP 1)

ERROR, 20210209164026, GET InstrumentListGetByName failed with 404

Traceback (most recent call last):

File "C:\Temp\DSS\dss-python-shareholder-rights-sample\fetchDSSshareHolderData.py", line 545, in <module>

main(sys.argv[1:])

File "C:\Temp\DSS\dss-python-shareholder-rights-sample\fetchDSSshareHolderData.py", line 478, in main

listId = getListId(headers2)

File "C:\Temp\DSS\dss-python-shareholder-rights-sample\fetchDSSshareHolderData.py", line 308, in getListId

print ('ERROR, ' + datetime.datetime.strftime(datetime.datetime.now(), "%Y%m%d%H%M%S") + ',' + k)

TypeError: can only concatenate str (not "dict") to str


--------------------------------------------------------------------------------------------------------

dss-rest-apidssdatascope-select
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.

Upvotes
Accepted
15.2k 41 12 19

Here is the response before/after importing the Entity and Instrument lists.

currDTstr=20210209092921
INFO, 20210209092921, Start time
INFO, 20210209092922, Successfully created token (STEP 1)
ERROR, 20210209092921, GET InstrumentListGetByName failed with 404
Traceback (most recent call last):
  File "fetchDSSshareHolderData.py", line 545, in <module>
    main(sys.argv[1:])
  File "fetchDSSshareHolderData.py", line 478, in main
    listId = getListId(headers2)
  File "fetchDSSshareHolderData.py", line 308, in getListId
    print ('ERROR, ' + datetime.datetime.strftime(datetime.datetime.now(), "%Y%m%d%H%M%S") + ',' + k)
TypeError: can only concatenate str (not "dict") to str

After:

currDTstr=20210209094605
INFO, 20210209094605, Start time
INFO, 20210209094606, Successfully created token (STEP 1)
INFO, 20210209094607, Fetched Instrument ListId for API_ShareHolder_Disclosure_InstrumentList sucessfully where ListId = 0x076fa6a1e0573d01 and Count = 26 (STEP 2)
INFO, 20210209094607, Fetched Entity ListId for API_ShareHolder_Disclosure_EntityList sucessfully where ListId = 0x076fa9ec1aa73d0e and Count = 24029 (STEP 3)
INFO, 20210209094608, Number of Report Templates is 4 (STEP 4)
INFO, 20210209094608, Current Report Template name = Demo_TicksTrades_Template (0x05f1623b11ab2f86) of type = THT (STEP5)
INFO, 20210209094608, Current Report Template name = IDReport (0x05af5bcd275b2f96) of type = IDP (STEP 5)
INFO, 20210209094608, Current Report Template name = export-xml.suffix.5D99E77C (0x05fa6722184b2f76) of type = EOD (STEP 5)
INFO, 20210209094608, Current Report Template name = export-xml.suffix.718D8638 (0x05fa66ee489b2f96) of type = EOD (STEP 5)
INFO, 20210209094608, End time


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.

Thank you very much!

Upvotes
15.2k 41 12 19

Hello @aya.nakamura,

Have you imported the CSV files into the GUI as described in the Readme file?

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.