Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TRTH /
avatar image
Question by nraval · Jan 15 at 03:19 PM · scheduled extractions

how to make scheduled extraction

Hi. I have a instrument list, report template, and recurring schedule setup through GUI. All I want to do is use the API to extract the file. How can I find the file to extract, and extract it at certain time during the day once the file is available?

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 · Jan 19 at 01:35 PM

Hello @nraval,

I would try to verify that there is a completed extraction(s) specifically, for this schedule, run "Get Completed By Schedule ID" to see all the completed extractions that were scheduled, :

{
                {protocol}}{
                {host}}{
                {api}}Extractions/ReportExtractionGetCompleted 

Do you see schedule IDs of completed schedules? Do you see scheduleID of the schedule you require? For example, I see:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ReportExtractions",
    "value": [
        {
            "ReportExtractionId": "2000000209996076",
            "ScheduleId": "MYSCHEDULEID",
            "Status": "Completed",
            ...
        },
        {
            "ReportExtractionId": "2000000210323640",
            "ScheduleId": "MYSCHEDULEID2",
            "Status": "Completed",
            ...

Try the call with these schedule Ids:

{
                {protocol}}{
                {host}}{
                {api}}Extractions/Schedules('{
                {scheduleId}}')/LastExtractio 

Should see the status in the format:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ReportExtractions/$entity",
    "ReportExtractionId": "2000000209996076",
    "ScheduleId": "MYSCHEDULEID",
    "Status": "Completed",
    "DetailedStatus": "Done",
    "ExtractionDateUtc": "2021-01-18T16:00:00.000Z",
    "ScheduleName": "myNonImmediateSchedule",
    "IsTriggered": false,
    "ExtractionStartUtc": "2021-01-18T16:00:03.176Z",
    "ExtractionEndUtc": "2021-01-18T16:00:17.656Z"
}

One reason I can think of is you would see the empty result if there is no completed extractions per this schedule

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 · Jan 15 at 04:33 PM

Hello @nraval,

For working with GUI Control generated extractions, I would like to suggest reviewing REST API Tutorial 12: GUI control calls.

It gives all the fundamentals of working with GUI controls and details how to:

  • Check the status of a scheduled extraction (to know if it is available and getting ExtractionId for the next step)
  • Retrieve the extraction report (by ExtractionId)

The tutorial retrieves by LastExtraction, which is the most common use case.

Your use case may require you to do more, if this is not the last extraction on the schedule, you may need to use ReportExtractionGetCompletedByScheduleId request, to examine the completed extractions for the schedule and determine the ones you wish to retrieve the results for using the same approach.

Comment

People who like this

0 Show 4 · 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
nraval · Jan 15 at 08:44 PM 0
Share

In the method GetCompletedByScheduleId, how do I get the id? I have an instrument list, report template, and schedule that are not going to change. All I want to do is download the extracted file? in all the sample code, you have to create an instrument list, report template and schedule.

avatar image
REFINITIV
zoya.farberov ♦♦ nraval · Jan 15 at 09:03 PM 0
Share

Hello @nraval,

If you do not know the scheduleId of the schedule you are looking for, via API you can run

GET /Extractions/Schedules 

REST API Reference

to obtain all existent schedule Ids and determine the id of the one you are looking to extract.

The tutorial shows how to recreate instrument list, report template and schedule in code, you do not need all this, as you already have those. So likely, you just need steps

"Check Status"

and, once completed, "Retrieve Extraction Report".

Makes sense?


avatar image
REFINITIV
zoya.farberov ♦♦ nraval · Jan 15 at 09:12 PM 0
Share

Hello @nraval,

Actually, if you know the name of your schedule (from GUI -> Schedules) a better approach may be

{
                    {protocol}}{
                    {host}}{
                    {api}}Extractions/ScheduleGetByName(ScheduleName='myImmediateSchedule') 

This will return the schedule Id for the submitted schedule name, for example:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Schedules/$entity",
    "ScheduleId": "0x060987291f2b3036",
    "Name": "myImmediateSchedule",
...

avatar image
nraval zoya.farberov ♦♦ · Jan 15 at 09:22 PM 0
Share

ok great. Let me give that a try! Thanks!

avatar image
Answer by nraval · Jan 15 at 09:59 PM

I'm able to get the schedule. But now I get this error (attached file) when I run ExtractNow method
Error.txt


error.txt (5.4 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.

avatar image
REFINITIV
Answer by zoya.farberov · Jan 15 at 10:16 PM

Hello @nraval,

GET URL does not not look right, looks off, and that is consistent with "Unmapped Request", this error usually comes up when URL can not be found.

Let us together verify each step we have discussed:

1. You run ScheduleGetByName and obtained ScheduleId for your shcedule

2. You check schedule status, as in tutorial

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/Schedules('0x05a2b98d233b3036')/LastExtraction

and

  1. Status is ok = 200 (otherwise it is not ready to extract yet, repeat periodically)
  2. Once status=200, from the result, you obtain ExtractedFileID such as
{

  "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ExtractedFiles
  "value":
   
      "ExtractedFileId": "VjF8MHgwNWEyYjk5ODRiNmIyZjk2fA
      "ReportExtractionId": "2000000000197524
      "ScheduleId": "0x05a2b98d233b3036",

3. You pass ExtractedFileId into extract the result as per tutorial:

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractedFiles('VjF8MHgwNWEyYjk5ODRiNmIyZjk2fA')/$value 
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 nraval · Jan 15 at 10:51 PM

Yes. But the lastextraction property is null even though I see an extracted file associated with the file

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 >
11 People are following this question.

Related Questions

What would be the url for obtaining the list of extractions given a ScheduleId?

  • 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