passing market segment code and country exchange code via the instrumentidentifier object

YD
YD Newcomer

Hi,

im trying to get similar data using the rest api comparing to the sftp file submit.

one of the values we are sending via the dss sftp is the market segment code or the country exchange code that are basically changing the market stock exchange.

what is the way to send these parameters via the instrumentidentifiers, I managed to pass user identifier, identifiertype, and the identifier but didn't find when to post these market segment code and the country exchange code via these object related to the reporttemplatetype composite.

for example in the sftp I will get the ric US.0001 while in the rest api I will get HK.0001 for the same identifier

thank you for any assistance

Y.D

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @YD

    InstrumentIdentifiers type doesn't have the market segment code and country exchange code properties. It provides the Source property. Please refer to this thread regarding how to use this property.

    You can use search in the REST API to search for instruments. For example, you can specify the DomicileCodes and ExchangeCodes in the /Search/EquitySearch.

    You also specify the InstrumentTypeGroups in the /Search/InstrumentSearch.

    1625112883907.png

    For more information about Search, please refer to the REST API Reference Tree.

    After getting results from the Search API, you can use the returned instruments with the On-Demand extraction.

Answers

  • YD
    YD Newcomer

    Hi Zoya,

    thank you for the respond,

    we are using both the composite world.


    in the ftp method we are sending 3 files -

    1.xml including struct of the fields we request

    2.xml including scheduling on when we would like to extract the report

    3.csv including 4 fields - user id, instrument id, instrument type id, optional field including country exchange code or market segment code.

    for now lets igore the scheduling xml

    via the rest api the implementation is as follow -

    var availableFields = ExtractionsContext.GetValidContentFieldTypes(ReportTemplateTypes.Composite);

    var extractionRequest = new CompositeExtractionRequest

    {

    IdentifierList = InstrumentIdentifierList.Create(

    new[]

    {

    new InstrumentIdentifier {

    Identifier = "191216100",

    IdentifierType = IdentifierType.Cusip,

    UserDefinedIdentifier = "AA" }

    }, null, false),

    new[]

    {

    //same fields requested in the ftp

    }

    var extractionResult = ExtractionsContext.ExtractWithNotes(extractionRequest);

    var extractedRows = extractionResult.Contents;


    Yaniv


  • YD
    YD Newcomer

    Hi,

    how to implement instrument validity,

    I understood that the fields i want to use as a coditions are part of GUI configuratiob but I would like to implement them via the sdk,

    thanks

  • YD
    YD Newcomer

    Hi jirapongse,

    thank you for the answer, just to clear it, it means I can use the source property for pricing source/exchange country code and segment code?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @YD

    You can not use the source/exchange country code and segment code in the On-Demand request extraction.