question

Upvotes
Accepted
1 0 1 1

Getting Latest Extraction Steps

I have a report template (FXMain) with a daily schedule (FXDaily). I am looking to use Microsoft Flow to get the latest extract for the report.

In the API documentation, it makes it seem as though I have to jump through numerous hoops to get to that data. None of those hoops seem to rely on the basic information I already have - the name of the report and the name of the schedule.


Step 1 Authenticate

POST https: //selectapi.datascope.refinitiv.com/RestApi/v1/Authentication/RequestToken HTTP/1.1 Prefer: respond-async Content-Type: application/json; odata=minimalmetadata { "Credentials" : { "Username" : "<Your Username>" , "Password" : "<Your Password>" } }

I then analyze this to get a token

Step 2 Get list of Schedules

POST https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/Schedules HTTP/1.1

sort through that to find the schedule Id

Step 3:For a given schedule ID, find the extractions

GET https: //selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/Schedules('0x05807049631b1f86')/LastExtraction HTTP/1.1 Authorization: Token <your_auth_token_goes_here> Prefer: respond-async

dig through those results to find the report ID

Step 4: Download the report

GET https: //selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ReportExtractions('6651450') HTTP/1.1 Authorization: Token <your_auth_token_goes_here> Prefer: respond-async


Is this the correct procedure?

Is there nothing simpler that will just say "Download the data for the last extract of report FXMain in the FXDaily schedule"?

extraction
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.

hi @tzak

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

Upvotes
Accepted
32.2k 40 11 20

Hello @tzak,

For scheduled extraction approach:

1. You will need to authenticate once, per 24 hours. Within 24 hrs you can reuse the existent authentication token.

2. Once you have your scheduleID at hand (or stored in the app) you will not need to do this, you will use the schedule ID that you have.

3. You will need to lookup the last extraction's job ID. It is unique and will be required to obtain the result. I would also consider checking the status of the job to be completed, prior to downloading the result.

4. Downloading the result will need to be done.

This approach covers scheduled extractions, emulating processing via DSS GUI.

---

You may wish to review "on-demand" extraction approach, please see REST API Tutorial 3: On Demand data extraction workflow for more information. It is also asynchronous, and processing is separated into several steps, it may potentially align better with your use case/requirements.

---

These are the two available approaches.

I hope this information helps.

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
1 0 1 1

Your reply is lacking some details.

I am able to get the last extractionId, but when I run the /RestApi/v1/Extractions/ReportExtractions('MyExtractionId') command, it just gives me ome metadata about the extraction and it does not have a jobId in there. How can I get the actual file containing the data if I have an extraction Id?

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
32.2k 40 11 20

Hello @tzak ,

Please see Tutorial: REST API Tutorial 12: GUI control calls: immediate extract, starting with section "Check Extraction Status" for the complete details on:

  1. Checking job status
  2. Awaiting job completion
  3. Retrieving extracted data

Is this information helpful?

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.