Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • DSS /
avatar image
Question by zohan.sim1 · Sep 26, 2020 at 07:59 AM · dss api

DSS EndOfDayPricingExtractionRequest json serialization

Hi there,

Iam calling DSS api, but can I serialize EndOfDayPricingExtractionRequest object to odata json before sending using HTTPClient ?

e.g. equivalent of calling this code but in HTTPclient

EndOfDayPricingExtractionRequest extractionEod = new EndOfDayPricingExtractionRequest

{

IdentifierList = InstrumentIdentifierList.Create(instrumentIdentifiers),

ContentFieldNames = tickerFields.ToArray()

};

extractionsContext.ExtractWithNotes(extractionEod);


I want to serialize extractionEod to this format below:

{""ExtractionRequest"": {

""@odata.type"": ""#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.EndOfDayPricingExtractionRequest"",

""ContentFieldNames"": [

""Exchange Code"",

""High Price"",

""Low Price"",

""Official Close Price"",

""Open Price"",

""Trade Date"",

""Volume""

],

""IdentifierList"": {

""@odata.type"": ""#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList"",

""InstrumentIdentifiers"": [{

""Identifier"": ""438516AC0"",

""IdentifierType"": ""Cusip""

},{

""Identifier"": ""IBM.N"",

""IdentifierType"": ""Ric""

}],

""ValidationOptions"": null,

""UseUserPreferencesForValidationOptions"": false

},

""Condition"": null

}

}";


If you got tutorial doc, please point that to me as well. That will be great

Thanks

Zohan



People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

5 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by zoya.farberov · Oct 06, 2020 at 02:08 PM

Hello @zohan.sim1,

Let me try to both explain a little about how the content is sent and make a suggestion?

Json content, for example taw EOD request:

{
  "ExtractionRequest": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.EndOfDayPricingExtractionRequest",
    "ContentFieldNames": [
      "Ask Price",
      "Asset Category",
      "Asset Category Description",
      "Asset ID",
     ...
      "Valoren",
      "Volume",
      "VWAP Price",
      "Wertpapier"
    ],
    "IdentifierList": {
      "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
      "InstrumentIdentifiers": [
        { "Identifier": "438516AC0", "IdentifierType": "Cusip" },
        { "Identifier": "IBM.N", "IdentifierType": "Ric" },
         { "Identifier": "0#US30YT=TWEB", "IdentifierType": "ChainRIC" }
      ]
    },
    "Condition": null
  }
}

is sent directly over HTTP directly. However, not right away. Two steps are required:

1. Authentication request has to happen, using valid login and password we obtain aobtain a valid authentication token. This step is described nicely in tutorial

https://developers.refinitiv.com/en/api-catalog/datascope-select/datascope-select-rest-api/tutorials

"REST API Tutorial 1: Connecting to the DSS server"

2. EndOfDay extraction request can happen, the json request will be sent over HTTP directly, but it's necessary to also submit a valid authentication token that is obtained in step 1, it will go in header. This is described in tutorial

"REST API Tutorial 2: On Demand End of Day Extraction"

I would like to suggest using a tool named Postman. It's free, quick and convenient to use, and allows to submit "naked" HTTP REST request and receive and examine the result.

https://developers.refinitiv.com/en/api-catalog/datascope-select/datascope-select-rest-api/tutorials

"REST API Tutorials Introduction" tutorial discuss how to start using Postman.

Command line curl utility does about the same, it helps to see the direct and "naked" interaction in action, but Postman makes it very easy and visual, whereas curl is command line, both would work for this purpose.

Let us know if this helps?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by zoya.farberov · Sep 29, 2020 at 03:47 PM

Hello @zohan.sim1,

You did not mention if you are using DSS .NET SDK to access. If you are please review .Net SDK Tutorial 5: On Demand: EoD extraction for an example of EOD request creation and submission.

Hope this helps you

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by zohan.sim1 · Oct 06, 2020 at 01:47 AM

Hi there,

Yes, we do use DSS .NET SDK.

Part of our upgrade to Net CORE, we are looking to call DSS REST API directly without using SDK.

In order to do that, I would like to find out how to serialise and deserialise EndOfDayPricingExtractionRequest object serialised to and from json message, before and after sending it to DSS REST API, and I can't seem finding the code from your SDK example there.

Could you please help? or even cut and paste the code here will be helpful

Thanks

Zohan

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by zohan.sim1 · Oct 12, 2020 at 08:31 AM

Thank you very much on the explanation. However, I would like simply to serialise EndOfDayPricingExtractionRequest object, instance of your SDK class below, to json request payload shown in your example above. Any sample code you can suggest? will JsonConvert.SerializeObject do the job?


namespace ThomsonReuters.Dss.Api.Extractions.ExtractionRequests

{

[TypeSerializer(typeof(EndOfDayPricingExtractionRequestJsonSerializer), "json")]

public class EndOfDayPricingExtractionRequest : ExtractionRequestBase

{

public EndOfDayPricingExtractionRequest();


[GeneratedCode("Microsoft.OData.Client.Design.T4", "1.0.0")]

public DssCollection<string> ContentFieldNames { get; set; }

[GeneratedCode("Microsoft.OData.Client.Design.T4", "1.0.0")]

public InstrumentIdentifierListBase IdentifierList { get; set; }

[GeneratedCode("Microsoft.OData.Client.Design.T4", "1.0.0")]

public EndOfDayPricingCondition Condition { get; set; }


[GeneratedCode("Microsoft.OData.Client.Design.T4", "1.0.0")]

public static EndOfDayPricingExtractionRequest Create(DssCollection<string> contentFieldNames, InstrumentIdentifierListBase identifierList, EndOfDayPricingCondition condition);

}

}

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by zoya.farberov · Oct 13, 2020 at 10:20 PM

Hello @zohan.sim1,

In my understanding, yes, you can use any general, non-Refinitiv API specific approach to serialize object.

Alternatively, if you are looking for the json print out of C# SDK app, look DSS .Net Example Application and how it produces HTTP output, request and result that it displays:

Perhaps GetHttpRequestSnippet code can be of use to you, or perhaps other pieces of the example code can be usefully utilized toward your requirement.


dssexampleseodrequest.gif (71.6 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
14 People are following this question.

Related Questions

DSS and TRTH file Validating

DSS API for automation manual config

Add Desciption to API data query

Is DSS can be used for getting real time data fast as a stream ?

The DSS API is returning wrong values in ISINs Codes

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges