Downloading Images contained within a cell.

Options
bpmuthus
bpmuthus ✭✭
edited 03/06/25 in API & Developers

Although I am working on PHP 8.2, I am just using APIs. So, I'll keep the specific question generic and on JSON.

The cell contains an image (png in this case). Manually, if I click on the image, it opens up a bigger version with a download button.

But, from the cell itself, I would like to perform a download through APIs. On the content within the cell, I do not see a URL or a way to download the file through API.

Any thoughts and suggestions would be greatly appreciated.


The JSON snippet of the desired cell is:

[62] => stdClass Object
(
[columnId] => 6668921772920708
[value] => sample.png
[displayValue] => sample.png
[formula] => =SYS_CELLIMAGE("sample.png","GP7ehMsDr7mpJ1DaAfWBkE",3536,2500,"sample.png")
[image] => stdClass Object
(
[id] => GP7ehMsDr7mpJ1DaAfWBkE
[height] => 3536
[width] => 2500
[altText] => sample.png
)
)

This cell (the one circled in red color) contains an image, and if I click on the image manually, it opens up the left hand side image where I can manually download.

1.png



Not sure if this is useful, but adding it as a safety measure Tags for Google search: SmartSheet API URL Link Image Download from a Cell

Answers

  • bpmuthus
    bpmuthus ✭✭
    edited 03/06/25

    BTW, I had printed the json for the entire row (And only a snippet of that row was copied earlier in the question), and upon looking at the entirety of json, there is no URL in the entire document ! ( So, sad: curve ball? )

    FYI: The images are attached onto the cells by clicking on: "Insert Image Button" on the smart sheet, like this:

    image.png
  • Georgie
    Georgie Employee
    edited 03/11/25

    Hi @bpmuthus,

    It’s possible to use the API to get a list of image URLs - check out this section of the API documentation: List Image URLs.

    In terms of downloading images from cells using API, this is not listed in our documentation, but I found the following thread in the API Community which might be useful - you could also post a new thread here if this thread isn’t quite what you’re looking for.

    Hope that helps!

    Georgie

    Need more information? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

  • prime_nathaniel
    prime_nathaniel ✭✭✭✭✭

    @bpmuthus

    1. Get sheet or row data from https://api.smartsheet.com/2.0/sheets/123456
    2. Get list of image ids from the results
    3. Construct JSON request for image URL api using those ids
    4. Get Image URL details from https://api.smartsheet.com/2.0/imageurls (using post)
    5. Process the resulting image URL list in PHP using curl or whatever other method you'd like
    6. Note you will have an exp limit so it may be best to intermediate a download list that can be updated / logged when items are processed / added so you can retry and refresh URLs if needed
    Screenshot 2025-04-01 150515.png Screenshot 2025-04-01 150506.png

    Principal Consultant | System Integrations

    Prime Consulting Group

    Email: info@primeconsulting.com

    Follow us on LinkedIn!

NEW Smartsheet API Documentation - bookmark the updated link! https://developers.smartsheet.com