question

Upvotes
Accepted
19 0 1 3

Data Library for .NET not working for RDP API company fundamentals

The client is using the Data Library for .NET (or RD Library for .NET). Please advise on the below query they are facing when trying to access the Company Snapshot and Pricing Streaming using the Data Library for .NET.

It includes the Refinitiv.Data.Content.Data.FundamentalAndReference request. However, using this request always fails producing


"""HTTPStatusCode"": 403","",Property,True,HTTPStatusCode

"""HTTPReason"": ""Forbidden""","",Property,True,HTTPReason

"""Contents"": {

""error"": {

""id"": ""78280294-0515-4a3d-813e-dd370f06bcf4"",

""code"": ""insufficient_scope"",

""message"": ""access denied. Scopes required to access the resource: [trapi.data.get.data.read]. Missing scopes: [trapi.data.get.data.read]"",

""status"": ""Forbidden""


For our application, the only way to get the Fundamentals is to use the Refinitiv.Data.Delivery.Request which is basically a wrapped https request, which we would prefer to avoid.

It is difficult to understand why an lendpoint request would work while the library request would not.

Also the endpoint requests seem to have the limitations regarding the programmatic universe or fields specifications using BodyParameters.


The is equally an issue is the availability of the request for the estimates and financial statements using the RD Library for .NET.

It looks like there is simply no namespace for these requests.

Does it mean that the only way is to perform the endpoint requests?



For <user-id1>, the specified endpoints work, however the problem with Library’s Refinitiv.Data.Content.Data.FundamentalAndReference interface
persists (the Refinitiv.Data.Content.Data.FundamentalAndReference fails while Refinitiv.Data.Delivery.Request.EndpointRequest works)
I am attaching the relevant part of the log, as you requested.

The other relevant information:

  • The snippet source code that encounters the problem =>

    var resp2 = Refinitiv.Data.Content.Data.FundamentalAndReference.Definition(some valid RIC).Fields("TR.Price52WeekHigh", "TR.Price52WeekHighDate").GetData();
  • Visual Studio and .NET versions => Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.9., .Net 6.0
  • Which session are you using? (The Desktop session or RDP session) => RDP (Platform) session
  • Log => attachedFundmentalsRequestWithError.txt


==============
Other issues:

- Passwords:

there is a very annoying issue with the <user-id2> account. The password contains an amp character (&) which is a restricted character in the XML.

As we use the xml config files, this causes the problem.

So unless you know how to escape this char in XML, can you please change the password so the restricted chars are not being used, pls?

Note that &amp does not work as the escape char.



#technologyrdp-api.netrefinitiv-data-librariesfundamentals
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
19k 85 39 63

Hi @bindia.nair

I want to confirm the specific issue. You are using a Platform Session and connecting into RDP and when you use the delivery layer you are not getting a permission issue. For example:

const string dataGridEndpoint = "https://api.refinitiv.com/data/datagrid/beta1/";

using ISession session = Sessions.GetSession();   // Will connect to a Platform Session
if (session.Open() == Session.State.Opened)
{
    var definition = EndpointRequest.Definition(dataGridEndpoint).Method(EndpointRequest.Method.POST);

    // Simple request
    var response = definition.BodyParameters(new JObject()
    {
        {"universe", new JArray("IBM.N") },
        {"fields", new JArray("TR.Price52WeekHigh", "TR.Price52WeekHighDate") }
    }).GetData();

And when you do the same thing from the Content layer:

using Refinitiv.Data.Content.Data;
...

// Create a session into the platform
var session = Sessions.GetSession();

session.Open();

var response = FundamentalAndReference.Definition("IBM.N")
                       .Fields("TR.Price52WeekHigh", "TR.Price52WeekHighDate").GetData();

1713446129645.png

You get a permission error?

Here are the scenarios where this can occur:

  1. Using a DesktopSession when using the Delivery layer and PlatformSession when using the Content Layer
  2. Using different Platform Sessions using different credentials.
  3. The RDP endpoint version has been updated and you are using a newer version. I just checked and the library is using the most recent version

The best way to demonstrate such behavior is to turn on debugging and create a sample example demonstrating this. The Content layer is using the Delivery layer so we should see how the calling sequence is going out on the wire for both tests.


1713446129645.png (24.0 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
27.5k 67 18 14

Hello @bindia.nair

About the password reset question, the client can ask their LSEG representative to change the password for them, or alternatively use the RDP /auth/oauth2/v1/token endpoint with newPassword parameter to reset the password.

HTTP Request:

POST /auth/oauth2/v1/token HTTP/1.1
Host: api.refinitiv.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 201
 
username=<user-id or machine-id>&password=<Old Password>&grant_type=password&scope=trapi&takeExclusiveSignOnControl=true&client_id=<App Key>&newPassword=<New Password>
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.