restyammer

How to delete messages older than a specific time from Yammer?


To meet our rentention policy, we need to delete messages older than a specific time from yammer. One option is to use powershell which is given here! I am looking for a REST API solution to solve this problem.


Solution

  • The Powershell script actually uses a REST endpoint to delete the messages they want to delete. It's documented here: https://developer.yammer.com/docs/messagesid

    The trick is to determine the message IDs for all messages posted before the given date. The script starts by iterating through a CSV exported by the Data Export API, documented here: https://developer.yammer.com/docs/data-export-api. The script iterates until it has collected all the message IDs for messages older than the given date. After it has all the message IDs, it has a loop that calls the aforementioned delete messages REST API endpoint for each of the collected message IDs.

    You can do the above with REST APIs and your preferred programming language.