Hi, we have a requirement to delete documents after a set period, not only in Teams folders, but in user personal folders too.
To do this, I’ve set up an application, got an access token and I’m iterating through several loops to get the member ids, get the files, get the cursor before getting the meta data via the path and comparing the server date attribute with a target date and time before eventually looking to delete the file! It’s long winded, s if there’s a better way, I’m open to it!
I’m using powershell and the Invoke-WebRequest, however, I’m getting odd results. Firstly it works for some memberIDs just fine, the “path” sent in the get_metadata post request works, just fine, however, for others it’s simply failing:
{"error_summary": "path/not_found/.", "error": {".tag": "path", "path": {".tag": "not_found"}}}
I can’t seem to find any common ground. Am I missing something? It’d almost be easier if it didn’t work at all!