Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
troy-carroll
New Member

Delete Global Announcement via API?

Jump to solution

For reasons, I want to know if it is possible to delete a global announcement via API? I have a script that will generate a global announcement (Account Notifications API), and I store and can reference each announcement's unique ID. But is there a way to remove an announcement for all users other than using the "end_at" field? 

The delete action of the Account Notifications API only seems to hide the announcement for a single user. I want to hide it for ALL users, or just delete the message entirely.

DELETE /v1/accounts/{account_id}/account_notifications/{id}

Surely there is a way to delete a global announcement via API, right? My only alternative that I can think of right now is to use the "update a global notification" (PUT) to change the role it is assigned to and maybe only show it to admins or a 'dummy' role, but that seems clunky.

Labels (1)
1 Solution

Accepted Solutions
robotcars
Community Champion

I tried to track this down through the network tab, and then had to ask on the IRC channel as I couldn't duplicate it via API. The answer was...

It's not mapped in the api.

View solution in original post

3 Replies
troy-carroll
New Member

Would still love to know an answer to this, but it did dawn on me that I could modify the end_at and 'expire' previous announcements as a way of getting rid of them. Still, being able to actually delete through the API would be ideal if there is a way.

robotcars
Community Champion

I tried to track this down through the network tab, and then had to ask on the IRC channel as I couldn't duplicate it via API. The answer was...

It's not mapped in the api.

Thanks for doing the legwork, Robert. I'm surprised that is something not included in the API, but now I know for sure.

The reason I was looking for this was to generate Canvas global announcements from our Campus emergency alert system. The difficulty was in keeping the announcements current, since each one gets a unique ID. I couldn't just leave them there or know when to end them based off the emergency. So I needed that way to delete them when necessary. I added some logic to my script that just changes the 'end_at' to a date in the past, so I'm good to go. Not quite as clean as deleting, but it's effective.