question

Upvotes
Accepted
64 3 5 7

do you have sample to use Scheduler to get corp event

do you have sample to use Scheduler to get corp event, because I need set the decimal of dividend, how could I do this, could I have a request sample?

tick-history-rest-api
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
Accepted
64 3 5 7

what's post URL I should use for this template?

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.

@bin, I edited my previous answer to add an answer to this query.

Upvotes
64 3 5 7

I got try to create a following report template and get bad request, any idea?

{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.CorporateActionsStandardReportTemplate","ShowColumnHeaders":false,"Name":"test1Name_TTemplate","Headers":[],"Trailers":[],"ContentFields":[{"FieldName":"Corporate Actions ID","Format":null},{"FieldName":"Corporate Actions Type","Format":null},{"FieldName":"Corporate Action Notes","Format":null},{"FieldName":"Delete Marker","Format":null},{"FieldName":"Event Status","Format":null},{"FieldName":"Capital Change Announcement Date","Format":null},{"FieldName":"Capital Change Deal Date","Format":null},{"FieldName":"Capital Change Ex Date","Format":null},{"FieldName":"Effective Date","Format":null},{"FieldName":"Capital Change Event Type","Format":null},{"FieldName":"Actual Adjustment Factor","Format":{"@odata.type":["#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat"],"DecimalPlaces":[12],"DecimalSeparator":["Period"],"UseLeadingZero":[false],"NegativeSignPosition":["Before"],"UseThousandSeparator":[false],"UseTrailingZero":[false]}},{"FieldName":"New Shares Terms","Format":null},{"FieldName":"Old Shares Terms","Format":null},{"FieldName":"Dividend Pay Date","Format":null},{"FieldName":"Dividend Announcement Date","Format":null},{"FieldName":"Dividend Ex Date","Format":null},{"FieldName":"Dividend Payment Type","Format":{"@odata.type":["#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat"],"DecimalPlaces":[12],"DecimalSeparator":["Period"],"UseLeadingZero":[false],"NegativeSignPosition":["Before"],"UseThousandSeparator":[false],"UseTrailingZero":[false]}},{"FieldName":"Dividend Rate","Format":{"@odata.type":["#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat"],"DecimalPlaces":[12],"DecimalSeparator":["Period"],"UseLeadingZero":[false],"NegativeSignPosition":["Before"],"UseThousandSeparator":[false],"UseTrailingZero":[false]}},{"FieldName":"Currency Code","Format":null}],"Condition":{"ReportDateRangeType":"Range","QueryStartDate":"2006-01-01T00:00:00.000Z","QueryEndDate":"2017-04-27T23:59:59.999Z","IncludeInstrumentsWithNoEvents":true,"IncludeNullDates":false,"ExcludeDeletedEvents":true,"IncludeCapitalChangeEvents":true,"IncludeDividendEvents":true,"IncludeEarningsEvents":false,"IncludeMergersAndAcquisitionsEvents":false,"IncludeNominalValueEvents":false,"IncludePublicEquityOfferingsEvents":false,"IncludeSharesOutstandingEvents":false,"IncludeVotingRightsEvents":false,"CorporateActionsCapitalChangeType":"CapitalChangeAnnouncementDate","CorporateActionsDividendsType":"DividendAnnouncementDate"}}

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
64 3 5 7

I format my message to make it easy to be read.

{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.CorporateActionsStandardReportTemplate",
"ShowColumnHeaders":false,
"Name":"test1Name_TTemplate",
"Headers":[

],
"Trailers":[

],
"ContentFields":[
{
"FieldName":"Corporate Actions ID",
"Format":null
},
{
"FieldName":"Corporate Actions Type",
"Format":null
},
{
"FieldName":"Corporate Action Notes",
"Format":null
},
{
"FieldName":"Delete Marker",
"Format":null
},
{
"FieldName":"Event Status",
"Format":null
},
{
"FieldName":"Capital Change Announcement Date",
"Format":null
},
{
"FieldName":"Capital Change Deal Date",
"Format":null
},
{
"FieldName":"Capital Change Ex Date",
"Format":null
},
{
"FieldName":"Effective Date",
"Format":null
},
{
"FieldName":"Capital Change Event Type",
"Format":null
},
{
"FieldName":"Actual Adjustment Factor",
"Format":{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat",
"DecimalPlaces":12,
"DecimalSeparator":"Period",
"UseLeadingZero":false,
"NegativeSignPosition":"Before",
"UseThousandSeparator":false,
"UseTrailingZero":false
}
},
{
"FieldName":"New Shares Terms",
"Format":null
},
{
"FieldName":"Old Shares Terms",
"Format":null
},
{
"FieldName":"Dividend Pay Date",
"Format":null
},
{
"FieldName":"Dividend Announcement Date",
"Format":null
},
{
"FieldName":"Dividend Ex Date",
"Format":null
},
{
"FieldName":"Dividend Payment Type",
"Format":{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat",
"DecimalPlaces":12,
"DecimalSeparator":"Period",
"UseLeadingZero":false,
"NegativeSignPosition":"Before",
"UseThousandSeparator":false,
"UseTrailingZero":false
}
},
{
"FieldName":"Dividend Rate",
"Format":{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat",
"DecimalPlaces":12,
"DecimalSeparator":"Period",
"UseLeadingZero":false,
"NegativeSignPosition":"Before",
"UseThousandSeparator":false,
"UseTrailingZero":false
}
},
{
"FieldName":"Currency Code",
"Format":null
}
],
"Condition":{
"ReportDateRangeType":"Range",
"QueryStartDate":"2006-01-01T00:00:00.000Z",
"QueryEndDate":"2017-04-27T23:59:59.999Z",
"IncludeInstrumentsWithNoEvents":true,
"IncludeNullDates":false,
"ExcludeDeletedEvents":true,
"IncludeCapitalChangeEvents":true,
"IncludeDividendEvents":true,
"IncludeEarningsEvents":false,
"IncludeMergersAndAcquisitionsEvents":false,
"IncludeNominalValueEvents":false,
"IncludePublicEquityOfferingsEvents":false,
"IncludeSharesOutstandingEvents":false,
"IncludeVotingRightsEvents":false,
"CorporateActionsCapitalChangeType":"CapitalChangeAnnouncementDate",
"CorporateActionsDividendsType":"DividendAnnouncementDate"
}
}

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
13.7k 26 8 12

@bin, the easiest way to debug such issues is to copy your request into Postman, and test it from there. That is exactly what I did to solve this. The error message I initially got was:

"Malformed request payload: Syntax error at Line 18, Char 147: Invalid array element type for property '@odata.type'.  Expected element type of 'ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldFormat', but found 'System.String'. {\"FieldName\":\"Actual Adjustment Factor\",\"Format\":{\"@odata.type\":[\"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat\"

Checking that line I saw that there were square brackets around all values:

{"FieldName":"Actual Adjustment Factor","Format":{"@odata.type":["#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat"],"DecimalPlaces":[12],"DecimalSeparator":["Period"],"UseLeadingZero":[false],"NegativeSignPosition":["Before"],"UseThousandSeparator":[false],"UseTrailingZero":[false]}},

I therefore removed them:

{"FieldName":"Actual Adjustment Factor","Format":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat","DecimalPlaces":12,"DecimalSeparator":"Period","UseLeadingZero":false,"NegativeSignPosition":"Before","UseThousandSeparator":false,"UseTrailingZero":false}},

I also removed them from the other 2 lines that had these useless square brackets.

After that I got a different error message:

"Validation Errors:Invalid Format for content FieldName \"Dividend Payment Type\".  Expected \"ThomsonReuters.Dss.Extractions.ReportTemplates.ContentFieldTextFormat\" but actual was \"ThomsonReuters.Dss.Extractions.ReportTemplates.ContentFieldNumberFormat\"

The message is self explanatory: the dividend payment type is a text, not a number, so it cannot be formatted like a number. After removing the formatting options for that field the request worked fine.

I hope this short explanation will help you understand how you can easily debug such issues.

Here is the corrected body for that query:

{
  "@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.CorporateActionsStandardReportTemplate",
  "ShowColumnHeaders":false,
  "Name":"test1Name_TTemplate",
  "Headers":[],
  "Trailers":[],
  "ContentFields":[
    {"FieldName":"Corporate Actions ID","Format":null},
    {"FieldName":"Corporate Actions Type","Format":null},
    {"FieldName":"Corporate Action Notes","Format":null},
    {"FieldName":"Delete Marker","Format":null},
    {"FieldName":"Event Status","Format":null},
    {"FieldName":"Capital Change Announcement Date","Format":null},
    {"FieldName":"Capital Change Deal Date","Format":null},
    {"FieldName":"Capital Change Ex Date","Format":null},
    {"FieldName":"Effective Date","Format":null},
    {"FieldName":"Capital Change Event Type","Format":null},
    {"FieldName":"Actual Adjustment Factor","Format":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat","DecimalPlaces":12,"DecimalSeparator":"Period","UseLeadingZero":false,"NegativeSignPosition":"Before","UseThousandSeparator":false,"UseTrailingZero":false}},
    {"FieldName":"New Shares Terms","Format":null},
    {"FieldName":"Old Shares Terms","Format":null},
    {"FieldName":"Dividend Pay Date","Format":null},
    {"FieldName":"Dividend Announcement Date","Format":null},
    {"FieldName":"Dividend Ex Date","Format":null},
    {"FieldName":"Dividend Payment Type","Format":null},
    {"FieldName":"Dividend Rate","Format":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat","DecimalPlaces":12,"DecimalSeparator":"Period","UseLeadingZero":false,"NegativeSignPosition":"Before","UseThousandSeparator":false,"UseTrailingZero":false}},
    {"FieldName":"Currency Code","Format":null}
  ],
  "Condition":{"ReportDateRangeType":"Range","QueryStartDate":"2006-01-01T00:00:00.000Z","QueryEndDate":"2017-04-27T23:59:59.999Z","IncludeInstrumentsWithNoEvents":true,"IncludeNullDates":false,"ExcludeDeletedEvents":true,"IncludeCapitalChangeEvents":true,"IncludeDividendEvents":true,"IncludeEarningsEvents":false,"IncludeMergersAndAcquisitionsEvents":false,"IncludeNominalValueEvents":false,"IncludePublicEquityOfferingsEvents":false,"IncludeSharesOutstandingEvents":false,"IncludeVotingRightsEvents":false,"CorporateActionsCapitalChangeType":"CapitalChangeAnnouncementDate","CorporateActionsDividendsType":"DividendAnnouncementDate"
  }
}

Added later, to answer your second query, on the URL:

The answer is in the API Reference Tree, here. Click on Step 2 and HTTP request.

This is the end point URL:https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/CorporateActionsStandardReportTemplates

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
64 3 5 7

I modefied my code and test via postman and my java application

I got

{
"error": {
"message": "The request is invalid."
}
}

This is my request

{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.CorporateActionsStandardReportTemplate",
"ShowColumnHeaders":false,
"Name":"test1Name_TTemplate",
"Headers":[

],
"Trailers":[

],
"ContentFields":[
{
"FieldName":"Corporate Actions ID",
"Format":null
},
{
"FieldName":"Corporate Actions Type",
"Format":null
},
{
"FieldName":"Corporate Action Notes",
"Format":null
},
{
"FieldName":"Delete Marker",
"Format":null
},
{
"FieldName":"Event Status",
"Format":null
},
{
"FieldName":"Capital Change Announcement Date",
"Format":null
},
{
"FieldName":"Capital Change Deal Date",
"Format":null
},
{
"FieldName":"Capital Change Ex Date",
"Format":null
},
{
"FieldName":"Effective Date",
"Format":null
},
{
"FieldName":"Capital Change Event Type",
"Format":null
},
{
"FieldName":"Actual Adjustment Factor",
"Format":{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat",
"DecimalPlaces":12,
"DecimalSeparator":"Period",
"UseLeadingZero":false,
"NegativeSignPosition":"Before",
"UseThousandSeparator":false,
"UseTrailingZero":false
}
},
{
"FieldName":"New Shares Terms",
"Format":null
},
{
"FieldName":"Old Shares Terms",
"Format":null
},
{
"FieldName":"Dividend Pay Date",
"Format":null
},
{
"FieldName":"Dividend Announcement Date",
"Format":null
},
{
"FieldName":"Dividend Ex Date",
"Format":null
},
{
"FieldName":"Dividend Payment Type",
"Format":null
},
{
"FieldName":"Dividend Rate",
"Format":{
"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ContentFieldNumberFormat",
"DecimalPlaces":12,
"DecimalSeparator":"Period",
"UseLeadingZero":false,
"NegativeSignPosition":"Before",
"UseThousandSeparator":false,
"UseTrailingZero":false
}
},
{
"FieldName":"Currency Code",
"Format":null
}
],
"Condition":{
"ReportDateRangeType":"Range",
"QueryStartDate":"2006-01-01T00:00:00.000Z",
"QueryEndDate":"2017-04-27T23:59:59.999Z",
"IncludeInstrumentsWithNoEvents":true,
"IncludeNullDates":false,
"ExcludeDeletedEvents":true,
"IncludeCapitalChangeEvents":true,
"IncludeDividendEvents":true,
"IncludeEarningsEvents":false,
"IncludeMergersAndAcquisitionsEvents":false,
"IncludeNominalValueEvents":false,
"IncludePublicEquityOfferingsEvents":false,
"IncludeSharesOutstandingEvents":false,
"IncludeVotingRightsEvents":false,
"CorporateActionsCapitalChangeType":"CapitalChangeAnnouncementDate",
"CorporateActionsDividendsType":"DividendAnnouncementDate"
}
}

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.

Click below to post an Idea Post Idea