Fetch assets without restrictions

Hi,

I’m trying to fetch assets from my updates from a mobile application. I can easily fetch the text and other stuff from these updates, but regarding the assets, it’s a quite hard.
From the application I am not allowed to fetch the assets as they are protected.

One option would be to only use the public_url but as stated in the documentation it’s only valid for 1 hour (seems to be wrong as I can query a 2 days old URL, without cache), so in theory, not usable.

Another option would be to somehow authenticate from the application to be able to access the assets, but I could not figure out how to achieve this (it seems I need to have some kind of access token stored in the cookies, but I am not sure).

In the end, how can I have access to the assets’ updates easily?

Thanks.

Hey @beben,

That’s a great question! I also notice this is your first time posting, so my warmest welcome to the community :slight_smile:

I’d love to make sure I understand your use case here. What is your application looking to achieve? Are you building a separate mobile app?

In terms of the public_url, it is indeed only available for 1 hour. But, if you re-run the query, you will get a new URL that you can use to fetch the file again. Does that make sense?

Once I understand a little more about your needs here, this should allow us to offer the best support.

-Alex

Hello @AlexSavchuk !
My application needs to fetch for one item, its updates, with the text_body and its assets (in our case it will only be images) to display them. From the app I also can add new updates to that particular item.

Regarding the public_url it means that each time I execute the query, the URL I get back is valid for 1 hour but is different from the old calls?

By the way, it seems I cannot send assets when creating a new update, is that really the case Updates ?

Thanks.

@beben

Thank you for circling back with me!

In case your users will have a monday.com user profile with access to that file, the asset’s url will be available for them to open and download. Otherwise, perhaps it might make sense for your app to query the public_url for files, and then present those files using that option.

Once you query the public_url field, you will get a new public_url each time, and each new URL will be valid for one hour.

I can confirm there isn’t a way to create an update with Files is not possible. You will first need to create the update, and then you can use that Update’s ID to add the file.

Let me know if you need anything else.

-Alex

Thanks for your reply, just saw how to upload an asset to the update Files

In my case, I’ll stick with the public_url, it’s the easiest way to fetch the image.

1 Like

@beben

Sounds good :slight_smile: Glad you were able to find the mutation to add a File/Asset to an update.

-Alex

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