0

Download File

by
Published Oct 17, 2025

This API downloads a file from a file upload, image, audio, video, or signature field of a specific record, which is present in 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
8
 * This API downloads a file from a file upload, image, audio, video, or signature field of a specific record, which is present in 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
  field_link_name: string,
17
) {
18
  const url = new URL(
19
    `${auth.baseUrl}/creator/v2.1/data/${account_owner_name}/${app_link_name}/report/${report_link_name}/${record_ID}/${field_link_name}/download`,
20
  );
21

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