0

Download File from Subform

by
Published Oct 17, 2025

This API downloads a file from a file upload, image, audio, video, or signature field of a specific subform record of a Zoho Creator application.

Script zoho Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Zoho = {
3
  token: string;
4
  baseUrl: string;
5
};
6
/**
7
 * Download File from Subform
8
 * This API downloads a file from a file upload, image, audio, video, or signature field of a specific subform record of a Zoho Creator application.
9
 */
10
export async function main(
11
  auth: Zoho,
12
  account_owner_name: string,
13
  app_link_name: string,
14
  report_link_name: string,
15
  record_ID: string,
16
  subform_link_name: string,
17
  field_link_name: string,
18
  subform_record_ID: string,
19
) {
20
  const url = new URL(
21
    `${auth.baseUrl}/creator/v2.1/data/${account_owner_name}/${app_link_name}/report/${report_link_name}/${record_ID}/${subform_link_name}/${field_link_name}/${subform_record_ID}/download`,
22
  );
23

24
  const response = await fetch(url, {
25
    method: "GET",
26
    headers: {
27
      Authorization: "Zoho-oauthtoken " + auth.token,
28
    },
29
    body: undefined,
30
  });
31
  if (!response.ok) {
32
    const text = await response.text();
33
    throw new Error(`${response.status} ${text}`);
34
  }
35
  return await response.text();
36
}
37