Delete Yammer old posts using Rest API

Occasional Visitor

Hello community,

 

We are trying to make some kind of policy for Yammer that deletes posts that are older than a certain period of time (e.g. 2 years). The approach we got into was to develop a windows service that run on a daily basis that will query for those posts and delete them via API.

 

The main problem here is how to solve the OAuth authentication, as we don't want to require user interaction for this to run, is there any way to automate that? (We tried using the token granted for an admin account but it expires after a certain period of time). Or is there any other way to accomplish this?

 

Thanks!

1 Reply

From my experience, I was able to store a token locally and it didnt have an expiration date.  How are you generating a token?  

 

I have not been successful in finding a way for non-web clients to authenticate automatically.  There are a lot of old posts of people asking the same thing and there are some really "wonky" workarounds... what works for us is storing a token locally that doesnt expire.

 

Just some a friendly note, but you should encrypt that token once stored locally... use DPAPI (https://msdn.microsoft.com/en-us/library/ms995355.aspx).  Fairly simple and provides a ton of value... especially since this token can do a lot!