New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
1 0 0 0

How can I correctly obtain your HPA Java SDK tool?

We are using Java and we expect to use RESTful HTTP requests to retrieve the K-line data for stocks. Here is an example: https://api.refinitiv.com/data/historical-pricing/v1/views/intraday-summaries/0700.HK?interval=PT5M&start=2023-08-01T00:00:00.000000000Z&end=2023-10-30T18:00:00.000000000Z&fields=BID,ASK,OPEN_PRC. Our project is built with Maven, and we are looking for an SDK that provides this HTTP request utility class. You should have this dependency, right? Could you please provide it to us along with a user manual? Thank you!

#technology#productdatajavasdktutorial
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
87.7k 294 53 79

@guoshuai

Thank you for reaching out to us.

According to the URL, you are using Refinitiv Data Platform APIs.

Currently, we don't have Refinitiv Data Platform for Java. We have Refinitiv Data Platform Libraries for Python. DotNet, and Typescript.

However, to use the RDP APIs in Java, you can use any Java HTTP Client libraries. You can download RDP Postman Starter Collection and Tutorial Samples. Postman can generate Java snippet code for a REST API call.

For more information, please refer to the Generate code for a REST API call using Postman in just a few clicks article.



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
28k 68 18 14

Hello @guoshuai

The API Playground page (https://apidocs.refinitiv.com/Apps/ApiDocs) also has a feature to generate the source code for each API endpoint.

You can click the "code": button under the URL as follows:

code.png


code.png (113.9 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.

Upvotes
1 0 0 0

1713925865518.png

this is our machineId:

GE-A-10288435-3-16229

Unable to get data. Code 403, Message: {"error":{"id":"d5163dd0-de03-4860-b6ff-475a1e12766c","code":"insufficient_scope","message":"access denied. Scopes required to access the resource: [trapi.data.historical-pricing.events.read]. Missing scopes: [trapi.data.historical-pricing.events.read]","status":"Forbidden"}}



1713925898832.png


1713925865518.png (330.9 KiB)
1713925898832.png (192.1 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.

Upvotes
87.7k 294 53 79

@guoshuai

The error indicates that this machine Id doesn't have permission to access the historical-pricing service.

"access denied. Scopes required to access the resource: [trapi.data.historical-pricing.events.read]. Missing scopes: [trapi.data.historical-pricing.events.read]","status":"Forbidden"

Please contact your LSEG account team or sales team directly to verify the permission.

You may also check the authentication request.

1713928174167.png

Set the scope in the body to trapi. The response will list all permissioned scopes.

If you have permission to access the historical pricing APIs, you should see the trapi.data.historical-pricing.xxx in the response.


1713928174167.png (78.9 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.

In this situation, it might be necessary to contact the account manager to directly address this error.

Requesting your response.




1713955572706.png

1713955572706.png (401.4 KiB)
Upvotes
28k 68 18 14

Hello @guoshuai

Please check the Limitations and Guidelines for the RDP Authentication Service article on the "Session Limits" section. The error indicates that you already have one active session and you try to login with the Password Grant for other sessions.

You can invalidate the current active session by using one of the following methods.

  • Set the takeExclusiveSignOnControl parameter to true when using the password grant with the /token endpoint. This parameter will kill the current session if the number of allowed sessions has been reached. Then, a new refresh token and access token are created and sent to an application. After that, the previous refresh token is revoked and can’t be used to renew an access token.
  • Call the /revoke endpoint with the refresh token of the active session to invalidate the refresh token and access tokens associated with that refresh token

I hope this information helps.


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.