Forum Discussion

omygoodness's avatar
8 years ago

Display results from Rest API call

I am trying to list all messages that have marked solutions like this: <#-- Endpoint to serve all accepted solutions --> <#assign apiVersion = "2.0"/> <#assign x= rest(apiVersion, "/search/message...
  • omygoodness's avatar
    8 years ago

    Few hours later I found solution to display all posts with accepted solutions - in this case it is simple rest call but you can build whatever call you want.

    If someone finds it useful I will be more then happy :)

    <#assign accepted_solutions = rest('/search/messages?filter=solvedThreads&solved=true').messages.message />

    <searchContent>
    <#list accepted_solutions as main_message>
    <post>
    <url>${main_message.@view_href}</url>
    <title>${main_message.subject}</title>
    </post>
    </#list>
    </searchContent>

     In result you get code for endpoint which produce simple formatted XML file