question

Upvotes
Accepted
23 2 3 2

Refinitiv Data Platform APIs - error when requesting data

I have my EDP login credentials and clientid/app key generated. Now I am running the first basic python script , but getting an error message. Seems like I get the token, but data request is failing, an someone please advise on what I may be missing:

c:\data\RDP\dev\sampleCode\IPA\python\samples>python timeSeries.py

Getting OAuth access token...

Reading the token from: token.txt

Token expired, refreshing a new one...

Requesting from TOKEN_ENDPOINT: https://api.refinitiv.com/auth/oauth2/v1/token

Saving the new token

Invoking data request

Unable to get data. Code 403, Message: {"error":{"id":"518d753f-fefb-4b9a-b93d-352424c96c39","code":"insufficient_scope","message":"access denied. Scopes required to access the resource [trapi.data.historical-pricing.summaries.read]","status":"Forbidden"}}


pythonrdp-apirefinitiv-data-platformipa
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 for your participation in the forum.
Is the reply below satisfactory in resolving your query?
If yes please click the 'Accept' text next to the reply.
This will guide all community members who have a similar question.
Otherwise please post again offering further insight into your 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


Upvotes
Accepted
22k 58 14 21

Your curl request was incorrect. Use this:

curl -v -X POST -H "Accept: application/json" -d "username=*****&password=*******&client_id=*****&grant_type=password&scope=trapi&takeExclusiveSignOnControl=true" https://api.refinitiv.com/auth/oauth2/v1/token
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
22k 58 14 21

Hi @Habib.Ahsan,

The error means, that you do not have permissions to run time series API call. Please contact your account manager to get this added. Alternatively, you can try an use the RDP services for which you do have permissions. See the scope parameter provided to you with the access token.

You can read about token scopes in the introductory tutorial Authorization - All about tokens.

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
25.3k 87 12 25

Hi @Habib.Ahsan

If this is for yourself and not on behalf of a customer, then you can raise a 'Service Now' ticket for 'Internal Ordering Request for Eikon, Elektron' and ask them to add this scope/licence to your MachineID.


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
23 2 3 2

Thank you both @Umer.Nalla and @Gurpreet. I have opened an OMS request to fix the permission issues.

Another interesting thing that came up while running the code in introductory tutorial on ARM-CFS authentication, I cannot run the token request using the curl script , I get 404 Page Not Found error:



But I can get a a new token when I run the python script - see attached file . I don't understand why the same endpoint would return two different responses with same credentials. I'd appreciate any guidance.

sampleTokenRequest.txt

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
22k 58 14 21

@Habib.Ahsan, Please do not post your password here!! This is a public forum. I have removed your information, so please upload it again - after masking the values!!

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.