Attachments vs Discussion with Attachments
Am using below Smartsheet API to get all the attachments. It brings the attachments from attachments and attachment available under Discussion. No problem in that.
smartsheetclient.Attachments.get_attachment(sheet_id, attachment_id)
While deleting the attachments using the below API. Here the problem is attachments section delete works fine and attachment under discussion give permission error. Am using admin user token to get and delete this file.
smartsheetclient.Attachments.delete_attachment(sheet_id, attachment_id)
Am not able to get attachment under discussion objects. Below is the reference and used the same code. However there is no attachments under discussions -> Array objects.
Answers
-
Hi @karthick
Were you able to figure this out? I was able to delete the attachment by getting the attachment id using GET attachment, and then using that ID in the Delete Attachment.
Here's how I did it in Postman:
Then
I did get a permission error when I was using an Admin access token trying to delete someone else's attachment, so I would suggest ensuring that your token is the appropriate one to make a deletion. Try the same action but ensure you're the one who uploaded the attachment.
Another option, if this is uploaded by someone else, would be to delete the entire discussion which would remove the image at the same time.
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Thanks @Genevieve P. for your response. Moreover I found the similar findings. We cannot delete attachment uploaded by others. If we delete the entire discussion then that discussion contains attachment also will get deleted.
Thanks for you reply and spending valuable time on this.
-
If you are accessing the API via an Admin account, you should be able to use the "Assume User" option on your API requests to impersonate the user who created the Discussion attachment.
I have not done this exact usage on Discussion Attachments, but. I have used Assume User to create discussion messages on behalf of a user.
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives