question

Upvotes
Accepted
1 0 0 1

How can I update ReportTemplate QueryStartDate ?

I would like to update QueryStartDate of ReportTemplate in TickHistoryTimeAndSalesExtractionRequest. I used PUT request to update this condition and sent request by python. But it did not work as I expected. QueryStartDate didn't change.

Is it possible to update this kind of condition using by API?

tick-history-rest-api
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.

@hikaru.isobe, considering your query is about TRTH, we moved it to the TRTH forum, it seems more appropriate, and will help people discover it.

@hikaru.isobe

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If yes please click the 'Accept' next to the appropriate reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

@hikaru.isobe, please be informed that a reply has been verified as correct in answering the question, and has been marked as such. Thanks, AHS

1 Answer

· Write an Answer
Upvotes
Accepted
11.3k 25 9 14

@hikaru.isobe

Do you mean that you would like to update the condition in the existing report template?

If so, you can update the QueryStartDate condition of a report template using REST API via HTTP PUT. Below are the instructions.

1. Get information of the report template.

Attribute of the report template cannot be partially updated, so you need to get all information of the report template first via HTTP GET.

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/TickHistoryTimeAndSalesReportTemplates('<report template id>') 

or

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/ReportTemplateGetByName(Name='<report template name>')

You will get the report template information as below.

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#TickHistoryTimeAndSalesReportTemplates/$entity",
    "ReportTemplateId": "0x05f0e7c6253b2f76",
   ...
    "Condition": {
        ...
        "ReportDateRangeType": "Range",
        "QueryStartDate": "2016-11-11T06:05:00.000Z",
        "QueryEndDate": "2018-10-01T06:05:00.000Z",
        "DateRangeTimeZone": "UTC",
        ...
    }
}

2. Modify QueryStartDate condition in the payload received from the first step, and then send HTTP PUT request with the modified payload to update the report template. You will get a response with 204 No Content if the update is success.

PUT https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/TickHistoryTimeAndSalesReportTemplates('<report template id>')
{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#TickHistoryTimeAndSalesReportTemplates/$entity",
    "ReportTemplateId": "0x05f0e7c6253b2f76",
   ...
    "Condition": {
        ...
        "ReportDateRangeType": "Range",
        "QueryStartDate": "2018-10-01T06:05:00.000Z",
        "QueryEndDate": "2018-10-02T06:05:00.000Z",
        "DateRangeTimeZone": "UTC",
        ...
    }
}
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.