API: Get URL of Attachment (File)

I have in my table a column of type “File” where I can upload PDFs to that row. From within Coda, I can click on that file and it opens a preview of the PDF.

Externally, I have an application that uses the API to pull the data from the Coda doc and display it. That all works well, except for the “File” column.

When I use the API to get the rows, I appear to only get a toText() version of the attachment name instead of any sort of usable reference to the attachment.

Is there a way to get the URL of the attachment so that I can have a user click on it to open the PDF from within my application? I was thinking that there would be some sort of toURL() type function that I could stick into a formula column that would do that, but wasn’t finding anything along those lines.

One of my colleagues pointed out that I had missed one of the API parameters included with the API.
Adding in a query parameter of valueFormat=rich solved this.

https://coda.io/apis/v1/docs/{DOC_ID}/tables/{TABLE_ID}/rows?valueFormat=rich

This includes, among other things, the direct URL of the document.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.