Search by File Code in FuturesAndOptionsSearch

Hi,

I want to use the FuturesAndOptionsSearch to get all RICs within a FileCode without creating Instrument Usage on my DSS ID. Can I search by FIle Code with the API and if yes will my results be limited/truncated to 5000 lines? If the results will be limited, is there a workaround to request batches of 5000 results one after the other?

I have tried to post the following, obviously without success:

Request:

{
"SearchRequest": {

"FileCodes": "7155",
"CurrencyCodes": null,
"ExchangeCodes": null,
"IdentifierType": null,
"Identifier": null,
"PreferredIdentifierType": "Ric"
}
}

Respose:

{
"error": {
"message": "Malformed request payload: Invalid cast exception for property FileCodes: Unable to cast object of type 'System.String' to type 'System.Collections.Generic.List`1[System.String]'."
}
}

Thanks in advance any comments.

Greg

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    FileCodes property is an array of string, not a string. Therefore, the request must looks like:

    {  
    "SearchRequest":{
    "FileCodes":[
    "7155"
    ],
    "CurrencyCodes":null,
    "ExchangeCodes":null,
    "IdentifierType":null,
    "Identifier":null,
    "PreferredIdentifierType":"Ric"
    }
    }

    The number of results is limited by maxpagesize. The default maxpagesize is 250.

    If there is a next page, the last property in the response will be "@odata.nextlink" field.

            {
    "Identifier": "UNGB231802400.U",
    ...
    }
    ],
    "@odata.nextlink": "https://hosted.datascopeapi.reuters.com/RestApi/v1/Search/FuturesAndOptionsSearch?$skiptoken='MjUw'"

    To get the next page, you need to use another POST request with the URL in "@odata.nextlink" field with the same SearchRequest in the payload.

    However, you can change the number of entries returned in the response by specifying odata.maxpagesize in the Prefer header.

    Prefer: odata.maxpagesize=500; respond-async

    For more information regarding maxpagesize, please refer to this question

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.