Download image from a record
How do you download an image file from a record? I can get the record ID and I have a field name called "Image 1". I want to download the actual image (.jpg). Can you give me an example?

3 comments
-
Kimberly commented
Hello John,
You would need to ensure your access token is URL encoded. If you're not certain how to do so, a quick internet search will bring up some sites that will encode the token for you. You would use the properly encoded access token in the URL. Hope this helps!
Regards,
Kim
-
John R commented
Hi Kimberly,
I copied both the access token and the api key directly from the account and pasted it into the URL as you suggested.
I'm getting: Invalid access token: invalid_token
The access token ends in an equals sign. Does it have to be changed or encoded or something to use it in the URL?
Also, looking at a URL for an image it has a number for what I'm guessing is the {field_name} so I've tried that and I still gives me the same invalid token error above.
Thanks,
-- John...
-
Kimberly commented
Hello John,
Thank you for reaching out. You can download images via the API by accessing the following endpoint: GET /openapi/views/{viewId}/records/{recordId}/files/{imagefieldName}
Furthermore, you can test the functionality in your preferred browser by entering a request URL as follows:
When using the request URL, the primary display will not look like anything happened (see screenshot), but you should notice the file has saved to the designated location on your computer (usually in the 'downloads' folder). You may also see the file in the bottom left corner of your browser (see screenshot).
Hopefully this helps! Please let us know if you have further questions.
Regards,
Kim