API to Download File

Dear Developers,

I have this code,

and that fileKey comes from a record, it’s from this one

and then, the response that I got from calling that API is this

Where did I do wrong? That code on the above picture already follow the guide from this link:

https://developer.kintone.io/hc/en-us/articles/212494468-Download-File

and is using GET method to be able to download a file using API.

Please help, any answer would be appreciated.

Thank you in advance

Hello Muhammad!

Hmmm, the code looks fine to me, but it might be the fact that you are missing “.json” after “/k/v1/file”
All the examples in the page that you showed me has it as “/k/v1/file.json”.
Please fix that part in see whether that will work.

Hope this helps.

Hi Yuzo,

Thank you for the answer!

Hi Muhammad, 

Unfortunately, it is not possible to achieve image file downloads with the kintone.api() methods. However, the Kintone JS SDK can be used for this purpose. 

Link (Kintone JS SDK Quickstart): https://kintone.github.io/kintone-js-sdk/latest/getting-started/quickstart-browser/

Link (Downloading files with JS SDK Quickstart): https://kintone.github.io/kintone-js-sdk/latest/reference/file/#uploadfilename-fileblob

The method detailed in the second article returns a file blob if the download is successful. I found this resource to be useful for reference: https://javascript.info/blob

Hope this helped!

hello ,

 

i downloaded applied for kintone licence but i confused that what have to do after that to open my kintone developement platform

plz help i am new in kintone

Hi Pradeep,

I checked our back end but it doesn’t look like your registration for the license went through.

Can you confirm that you signed up for the developer license through the following page?
https://developer.kintone.io/hc/en-us/articles/219946307

If you have not, please fill out the form at the bottom of the page and we will process your registration as soon as possible!