TRKD get RetrieveHeadlineML_1 write query conditions

Options
895669342
895669342 Newcomer

use java program language develop,get news headline。

use httpclient httpPost json request.but how do do write filter conditions; etc. code=GOL and language=English。

ths!

image

Tagged:

Best Answer

  • Gurpreet
    Gurpreet admin
    Answer ✓

    Hello @895669342, In both SOAP or JSON version of API, you can include a Filter in your request to narrow down the search results.

    See section 13.3.1.8 of the TRKD documentation to see the filter structure. For GOL and English you will use ```Value Text = GOL, Class = Any``` and ```Value Text = EN, class = language```

    Samples filters:

    JSON:
    "Filter": [{
    "And": {
    "MetaDataConstraint_typehint": [
    "MetaDataConstraint",
    "MetaDataConstraint"
    ],
    "MetaDataConstraint": [{
    "Value": {
    "Text": "ECI"
    },
    "class": "topics"
    }, {
    "Value": {
    "Text": "EN"
    },
    "class": "language"
    }
    ]
    }
    }
    ]

    SOAP:
    <Filter>
    <And xmlns="http://schemas.reuters.com/ns/2006/04/14/rmds/webservices/news/filter">
    <MetaDataConstraint class="Attribution">
    <Value>Reuters</Value>
    </MetaDataConstraint>
    <MetaDataConstraint class="Companies">
    <And>
    <Value>MSFT.O</Value>
    <Value>YHOO.O</Value>
    </And>
    </MetaDataConstraint>
    <FreeTextConstraint where="headline">
    <Value>Merger</Value>
    </FreeTextConstraint>
    </And>
    </Filter>

Answers

  • Gurpreet,I want this answer。

  • robin
    robin Explorer

    This question shows screenshot from overview tab in support portal. You can see xml or json for any sample shown there simply:

    - go to develop tab (to right of "overview" in top right bar)

    - select "load from" and choose same example you are interested (everything from overview tab should be listed)

    - select "inspect" and it will show you soap/xml

    - or select "json" option and reload example, select inspect and it will show all required headers and the json body