question

Upvotes
Accepted
1 0 0 1

Can I hard Code endpoints in my request code?

Can I hard Code endpoints in my request code?

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.

Upvote
Accepted
13k 32 12 18

Hi, @marcwarren.bajo,

If you are using streaming data, then you will have to use service discovery, since the list of endpoints in the response, depend on capability assigned to your ID.

For REST data requests, RDP is designed as an evolving platform, and the URL structure along with method signatures can change over a period of time. More specifically, a version number has been included in the URL. Upon a version change, older API endpoint will keep on providing data for some time. Its best, to keep the endpoint URL's in the configuration part of your codebase. See the python samples provided on the forum.

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
7.6k 15 6 9

@marcwarren.bajo

Suppose you intend to query data from the RDP REST API service and maintain the endpoint URL in your own app. You can also use RDP Library for Python and use Endpoint class to retrieve data like the following sample snippet of codes to retrieve JSON response messages from the top-news endpoint. You can create your own configuration to keep the endpoint like the suggestion from Gurpreet.


import refinitiv.dataplatform as rdp
session=rdp.open_platform_session(....)
endpoint = rdp.Endpoint(session,url='https://api.refinitiv.com/data/news/v1/top-news')
resp=endpoint.send_request()
if resp.data.raw is not None:
    print(resp.data.raw['data'])


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.

Hello @marcwarren.bajo

Please note that you can get the API endpoint information from the API Playground page.

Click below to post an Idea Post Idea