For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
0 0 0 3

How can I retrieve Platts Corrections through DSS REST API

When client subscribe platts through DSS, they can get daily corrections file in extraction. How can they extract that Corrections detail through API?

dss-rest-apidatascope-selectdss
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

This file is generated by DSS automatically. I can get this file everyday. but client needs it through API

无标题.png (20.8 KiB)
Upvote
Accepted
462 9 7 14

@veerapath.rungruengrayubkul

Hi Veerapath,

Thanks for finding out the answer from Jiajia and Bob.

Posting it below in case anyone else has the same question.

Both use GET (can be used in internet browser), step:

1) endpoint https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/OtherFiles/ then

2) use https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/OtherFiles('{OtherFileId }')/$value to get the content.

Cheers,

Gareth

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@gareth.teage,

Thank you for sharing the information. Glad to know that the method works.:)

Thank you for sharing, this is useful !

Upvote
11.3k 25 8 13

Hi @tao.yuan,

To retrieve last extraction file, you need to know Schedule ID by using GetByName endpoint with Schedule name.(i.e. "PlattsCorrections"). The Schedule ID should not be changed for a schedule, so application can store and reuse the ID for next retrieval.

Below is the sample of request.

Request:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ScheduleGetByName(ScheduleName='PlattsCorrections')
Response:
{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Schedules/$entity",
    "ScheduleId": "0x05b6ab1f77eb3026",
    "Name": "PlattsCorrections",
    "OutputFileName": "",
    "TimeZone": "SE Asia Standard Time",
    "Recurrence": {
...

Below are the steps to get the extraction result from Schedule ID via API.

1) Get last Report Extraction ID for the Schedule ID using Schedule.LastExtraction.

Your corrections file is generated daily, so the schedule should be recurring. You need to get only last extraction information.

In this sample, the Schedule ID is '0x05b6ab1f77eb3026'. The last Report Extraction ID received in this sample is '2000000087212479'.

Request:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/Schedules('0x05b6ab1f77eb3026')/LastExtraction
Response:
{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ReportExtractions/$entity",
    "ReportExtractionId": "2000000087212479",
    "ScheduleId": "0x05b6ab1f77eb3026",
    "Status": "Completed",
...

2) Get Extracted File ID of extracted data using ReportExtraction.FullFile.

Normally an extraction will generate two files; data and Notes. You need to get ExtractedFileId for data file. The Extracted File ID for data file in this sample is 'VjF8fDUwNjM3NTg2OQ'

Request:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ReportExtractions('2000000087212479')/FullFile
Response:
{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ExtractedFiles/$entity",
    "ExtractedFileId": "VjF8fDUwNjM3NTg2OQ",
    "ReportExtractionId": "2000000087212479",
    "ScheduleId": "0x05b6ab1f77eb3026",
    "FileType": "Full",
   ...

3) Retrieve data with ExtractedFileId using GetDefaultStream.

Finally, you can retrieve the extracted data.

Request:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractedFiles('VjF8fDUwNjM3NTg2OQ')/$value 

For more detailed information, please see this GUI control calls: immediate extract tutorial.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
462 9 7 14

Hi,

I also need some help with this please. This thread seems like the same question so thought it was relevent not to raise a new thread.

So I also get Platts Corrections files generated into my DSS User ID. This appears to be done daily and looks like the below:

However, and this is where I think the above workflow doesn't work for these files specifically. These are files which are placed into a user's Extracted Files based on a specific permission/service, and not generated through a user's schedule (so no schedule will exist for me to use), and no Notes are generated.

Indeed I had thought there maybe some kind of hidden reserved name but...:

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ScheduleGetByName(ScheduleName='PlattsCorrections')

Gave me:

{

"error": {

"message": "Exception of type 'ThomsonReuters.Dss.Core.Exceptions.NotFoundException`1[ThomsonReuters.Dss.Api.Extractions.Schedules.Schedule]' was thrown."

}

}


I need to be able to get to ExtractedFileId for use with Get Read Stream in the minimum number of steps to:

https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ExtractedFiles('<ExtractedFileId>')/$value

How can I do this please?

Many thanks,

Gareth


screenshot.png (28.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

On doing a bit more investigation it seems this is expected and is handled by endpoint:

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ReportExtractionGetOtherFiles

Though I still need to know the step(s) to get to stream...if anyone know hoping they can help.


Both deliver exactly the same response, seems like they are interchangeable.

Hi @gareth.teage

I have done some search. Yes, you are correct. The PlattsCorrection is generated automatically by DSS, not a user's schedule. So, this method I provided may not work. I will contact DSS support for the question.

Click below to post an Idea Post Idea