size file REST API-DataScope (code?)

Options
s61670
s61670 Explorer

File size downloaded via REST API

image

File size ordered via DataScope

image

the forum answered me that the file size on the Refinitiv server should be viewed through DataScope.

What if there's no size?

Is it impossible to send a request through the REST API and receive a response in which information about the size of the downloaded file?

Why such difficulties?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @s61670

    This is a method that I used.

    In the note text, there is an "Extraction ID" field. I extract the extraction ID from the note text.

    string extractionID = getExtractionID(extractionResult.Notes[0]);
    ...
            static string getExtractionID(string note)
            {
                string pattern = @Extraction ID: ([0-9]+);
                string extractionID = "";
                Regex rgx = new Regex(pattern);
                Match match = rgx.Match(note);
                if (match.Success)
                {
                    string[] words = match.Value.Split(':');
                    extractionID = words[1].ToString().Trim();
                    Console.WriteLine("ExtractionID: {0}", extractionID);
                }
                return extractionID;
            }

    After getting the extractionID, I use it with the ExtractionsContext.ReportExtractionOperations.Get() method to get the file size.

                var result = ExtractionsContext.ReportExtractionOperations.Get(extractionID);
                ExtractionsContext.LoadProperty(result, "FullFile");
                long fileSize = result.FullFile.Size;
                Console.WriteLine("File Size: {0}", fileSize);

Answers