question

Upvotes
Accepted
3 0 0 1

All data platform session queries return None (python)

Hello,

I started using the refinitiv platform session API earlier today and while I am able to start a session and validate that it's been opened, any requests I make - rdp.get_snapshot, etc - return Nonetype objects. I'm assuming there's an issue of some kind with my configuration but I'm unclear as to what kind of error it is since the session appears to open fine. I am using refinitiv-dataplatform 1.0.0-alpha.9 with python 3.9.5.

Sample code:

session = rdp.open_platform_session(

app_key,

rdp.GrantPassword(

mach_id,

mach_pw

)

)

x = rdp.get_snapshot(

universe = ['GBP=','JPY='],

fields = ['BID','ASK']

)

print(x)

rdp.close_session()


Outputs

None

UserWarning: Unclosed <httpx.AsyncClient object at 0x7fe7108dc6a0>. See https://www.python-httpx.org/async/#opening-and-closing-clients for details.

Any help would be appreciated!

rdp-apirefinitiv-data-platform
icon clock
10 |1500

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

Upvotes
Accepted
20.3k 73 10 20

Hi @carter.alexander

The fact you see the above insufficient scope message confirms you have a valid machineID and password and that you are authenticating correctly.

The issue is that you are not licenced for whichever data you are trying to request.

I have emailed you directly so I can check your credentials.

icon clock
10 |1500

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

Upvotes
20.3k 73 10 20

Hi @carter.mccullum

Please add the following line to help understand why you are receiving no data back.

print(x)
print(rdp.get_last_status())
rdp.close_session()

The usual reason is that you are not licenced for the instruments you are requesting e.g. trial account.

you can also try requesting the delayed versions of the same RIC i.e.

universe = ['/GBP=','/JPY='],

If you are licenced for streaming data but not for fee-liable data (e.g. a trial account), then you should be able to get the above RICs.


icon clock
10 |1500

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

Upvotes
20.3k 73 10 20

Hi @carter.mccullum

You can also try the following - which uses the RDP Snapshot API - whereas the code above is using the Streaming interface to request a snapshot.

universe = ['EUR='] 
fields = ['ASK', 'BID']
response = rdp.Pricing.get_snapshot(universe, fields)
print(response.data.df)
print(response.status)

If you are not permissioned for either of the above, then you will need to contact your Refinitiv account representative to discuss your licence requirements.

icon clock
10 |1500

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

Both this and the above option return the output {'http_status_code': 403, 'http_reason': 'Forbidden', 'error': {'id': '4d2b3603-221d-441b-b9f9-17873bfb1b5d', 'code': 'insufficient_scope', 'message': 'access denied. Scopes required to access the resource: [trapi.data.pricing.read]. Missing scopes: [trapi.data.pricing.read]', 'status': 'Forbidden'}}. I am using a trial account - would it be best to reach out to our account representative to ask about what apis we do have access to?

Upvotes
20.3k 73 10 20

Hi @carter.alexander

I am not part of the account/sales team - but I did try to check your email address and I don't see any Account Team contact against your details.

Did you actually receive a Welcome Email that contained a MachineID - which looks something like GE-A-xxxxxx-x-xxxx and a link to set a long password (30+ characters)?

If not, then all you may have is a basic My.Refinitiv login - which only allows access to the dev portal documentation, articles and tutorials.

If you want to discuss a free trial etc please use the Contact us | Refinitiv page and your query will be directed to the New Business Team.

icon clock
10 |1500

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

Hi @umer.nalla - I am using a trial account assigned to our institution and we have received both a machine id and a machine password. I am able to generate OAuth2 tokens/establish a connection to the rdp platform using the machine id/password - I am just unable to actually query any data via that connection.
Click below to post an Idea Post Idea