How do I delete a message permanently using cumi? I tried this
There are no errors but the message never gets removed from Trash folder. I'm connecting to UnityConn ver 9.0.1
A POST API call on the Deleted Items folder can be used to empty the whole folder. The messages are hard deleted.
Thanks and Regards,
So, there is no option to hard delete a single message? The only option is to clear the whole folder?
Sure you can delete an individual message – doesn’t matter if it’s in the inbox or deleted items folder. I just used the CUMI REST SDK to write up a quick test that:
Fetched my test user (“jlindborg”) which I assume you already know how to do.
Then for that user I fetch all their deleted messages – you can do this with the following GET construct:
Now I pick one of the messages returned (in my case the ID is: 0:9090453f-4ab0-40ae-b035-6313d2a67b21) and then issue a delete command like this:
Note the “userObjectId=xxx” passed there = that’s the user that owns the message – since I’m logged in as an administrator that’s not the same user that owns the message I’m deleting, with CUPI I have to specify the user’s ID here or it wont find the message being referenced – note that with both calls. If you’re using CUPI for User’s this isn’t necessary since you’re acting on your own behalf and have only access to your own messages which is assumed.
Also note the “harddelete” item on the delete call – to remove something from the deleted items folder this is necessary – when deleting from the inbox its optional (depending on if you want a copy going to the deleted items folder or not).
If you want to see this in action I can do a TOI video showing how this is built in the CUPI REST SDK – just a few lines of code, easy peasy:
That's the exact delete command I used but the message doesn't get removed from Trash. I'm using CUMI and mailbox delegate account. Is this dependent on the unity connection setting of how long messages should remain in 'deleted items' folder?
no - I tried it on a couple systems (9.1 and 10.0 ES11), they're definitely removed - no bearing on the setting for how long they stick around in the deleted folders. In fact looping my script ti runs till there's no more deleted items and then throws back the "no deleted messages" error at the top of my script so I know for sure they're gone.
be double sure you pass the "harddelete" parameter as true - that is required.