API to download attachments in Doc

Hello, hello,

There doesn’t seem to be any mention of getting attachment(s) within a Doc via API GET.

How do I do this please?

Screenshot 2022-07-13 at 4.15.20 PM

@charleslcso if the file is public you can download it using site_url/files/file_name

1 Like

Great! I’ll try!

By the way, API GET on a Doc won’t list attachments in JSON reply, right?

@charleslcso no it won’t . but if you make a file field in the doctype , things will be a lot easier

try to query /api/resource/File with appropriate filters for doctype and docname.

2 Likes