How to download files via sdk

,

Hello,

How does one download files via the SDK? I get a url which I can follow to get a 302, which points me to a url I can download from, but I have to go through all the hassle of generating an application session; I can’t seem to do it directly via the SDK. Am I missing something?

Thank you!

Hello there @anelson and welcome to the community!

I hope you like it here.

As of today, there is no SDK method to directly download a file.

Let me know if you have any other questions :slightly_smiling_face:

Cheers,
Matias

2 Likes

Thank you for the welcome and for answering; do you know if there are there any plans to allow this? It’s a pretty big gap in being able to pull data from the boards programmatically and is going to affect how we build our workflows (and how much we use Monday).

Thanks!

With the API (which you can access using the .api method on the monday sdk client) you can get a public_url. There just isn’t a direct SDK get file method.

Get all assets with public_url for an item.

{
  items(ids: 4612078052){
    assets {
      id
      public_url
    }
  }
}

Get just an asset if you have the asset’s ID already.

{
  assets(ids: "1084643597") {
    id
    public_url
  }
}
2 Likes

Thank you @cody. That is correct.

@anelson I do not have an ETA on when this could be implemented for now.

I have added your vote for this request :grin:

Cheers,
Matias

2 Likes

Cody,

This is exactly what I needed. I was able to see the protected_static url but needed to have a way to follow the 302; this just gives me the result of that directly. Thank you so much!

1 Like

just an important note - the public URL expires after an hour. So, while you can use it to get the file as part of your workflow, do not rely on the URL to provide long term access to the file.

2 Likes

Thank you again @codyfrisch !

2 Likes