Forum Discussion

dhx-ds's avatar
dhx-ds
Contributor
6 years ago

How can I retrieve messages marked as spam via REST API?

When querying the messages collection object via REST API using the message id of any spam message, I get 200 with no items returned. Being a moderator, I can see those messages in browser using the same id in the URL but can't retrieve the message via API. Is it moved into another collection in the backend?
Appreciate any help on this.

Thank you,

Yathaarth

  • Hi dhx-ds ,

    can you share your API request (or at least an example of them)? Which message attributes do you use to identify messages as spam?

    Best regards

    Christian

    • dhx-ds's avatar
      dhx-ds
      Contributor

       

       

      SELECT+id,+board.id,+topic.id,+author.login,+subject,+body,+is_solution,+view_href,+post_time+FROM+messages+WHERE+id+%3d+'<MESSAGE_ID>'

       

      Our spam messages are moved to a moderation and then quarantined. I am able to see them in the browser using the message id, but can't get them via the API.  Any thoughts?

       

       

      • cike's avatar
        cike
        Champion

        Query looks ok (I guess the '+' signs are from an encoded string^^).

        What does your term "messages are quarantined" mean in detail? Are those messages moved to specific board?

        If this is the case I propose to add the board.id as and additional constraint to improve your search results.

        Did you already test your query in the API Browser in Studio?