Are there any API endpoints to upload attachments to a card?

  • 12 November 2020
  • 6 replies
  • 102 views

1 more question I need to ask. Is there any API to upload attachments to a card. https://developer.getguru.com/reference

Mary Houston 3 years ago

Great question! If you are using the manual sync to create cards, you would create a `resources/` folder in your directory. From there, you can reference the attachment in the card's content file (see the Referencing Other Cards, Boards, Board Groups, and Resources section of the Manual Sync documentation)

If you are just trying to create a card via a `POST https://api.getguru.com/api/v1/cards/extended`, it is a bit tricky since we also use third-party file uploaders to accomplish this. You can to link to where the attachment is already being stored. So the only way to upload attachments to cards is via the sync process or the import process.

I will send this to product feedback to add an endpoint solely for attachment uploads so it is easier to reference attachments when creating cards via the API
View original

6 replies

Userlevel 4
Badge
Great question! If you are using the manual sync to create cards, you would create a `resources/` folder in your directory. From there, you can reference the attachment in the card's content file (see the Referencing Other Cards, Boards, Board Groups, and Resources section of the Manual Sync documentation)
If you are just trying to create a card via a `POST https://api.getguru.com/api/v1/cards/extended`, it is a bit tricky since we also use third-party file uploaders to accomplish this. You can to link to where the attachment is already being stored. So the only way to upload attachments to cards is via the sync process or the import process.
I will send this to product feedback to add an endpoint solely for attachment uploads so it is easier to reference attachments when creating cards via the API
Userlevel 4
Badge
There is also a Developer Category channel for any other API topics/conversations!
Awesome. Thank you so much for your response.

Hey, Mary! Thanks for breaking that down. I've been wrestling with this exact issue for a project I'm working on. The manual sync process felt a bit cumbersome for our use-case, especially when dealing with multiple attachments. Your mention of considering a dedicated endpoint for attachment uploads via the API is music to my ears. Looking forward to it, and I really hope it gets prioritized. Would make life so much easier! Cheers! 🙌 

1 more question I need to ask. Is there any API to upload attachments to a card. 

Hey, I've run into something similar while working with the Guru API. It seems that verificationReasons doesn't always populate as expected, particularly for expired cards.

One workaround I found was to also fetch the lastVerifiedDate attribute. You can compare this date to the card's expiration settings to determine if it's stale or not. It's not as straightforward as simply checking for "EXPIRED" in verificationReasons, but it can be a reliable alternative when that field is empty.

Another thing you might want to look into is the API rate limit or data cache, as sometimes stale or incomplete data might be served. But based on my experience, checking lastVerifiedDate was the most consistent way to go.

I agree that it's a bit weird how the web app seems to have that information while the API endpoint doesn't. Maybe they're using some internal logic that's not exposed via the API.

Hope this helps, and let me know if you find a better solution! 

Hi, I would also like the ability to upload attachments (e.g. html) via the API.

Then reference the attached files as hyperlinks and use iframes to embed the html in the cards

The sync process is not a great solution for my use case (updating cards with attachments via Github), because when you download a collection, the files are in html, and the card/folder names use the guru IDs, e.g. `05b2e2eb-a7de-4671-1a5t-480624681cd0`, which renders them unreadable

Reply