Skip to main content

Hello, community!

I have a question regarding attachments on a Miro board.

I’m currently working with a board where I used the upload feature to add a PDF file. My goal is to retrieve the binary data of the PDF through the API, but the process seems a bit complex:

  1. First, I send a request to https://api.miro.com/v2/boards/{board_id}/items to retrieve the item ID for the PDF document.
  2. Then, I use this ID in another call to https://api.miro.com/v2/boards/{board_id}/documents/{item_id}.
  3. From this response, I extract the "documentUrl", which looks something like https://api.miro.com/v2/boards/uXjVOfjkmAk=/resources/98765467890987654?redirect=false.
  4. I make a request to this documentUrl and get another "url" property with a link to the PDF file, containing an Expires timestamp and signature.

Finally, I use this last URL to make a request and download the actual binary file.

I'm wondering if there’s a more efficient way to directly fetch the binary without going through multiple steps. Any insights or suggestions would be greatly appreciated!

Thanks,
Vas

Hi Vas! Currently, there isn't a more direct method to fetch the binary data of a PDF file uploaded to a Miro board through the API. As of now, the process you described is indeed the standard way to retrieve the binary data of a PDF file.

For the context, the initial requests are necessary to identify and verify the document item on the board, ensuring that you have permission to access it. The documentUrl link provides a secure time limited URL to prevent unauthorized access. This link then generates another URL containing an Expires timestamp and signature which protects the PDF file. These layers help to secure access to sensitive data.

So until Miro introduces a simpler endpoint for direct binary retrieval, this is the recommended approach.


@Ruslan Kotowski 

Thanks for your response.

 


Reply