//native
type Zoho = {
token: string;
baseUrl: string;
};
/**
* Download Bulk Read Result
* To download the bulk read job as a CSV file. The file needs to be in .zip format. Extract it to get the CSV file.
*/
export async function main(
auth: Zoho,
account_owner_name: string,
app_link_name: string,
report_link_name: string,
job_ID: string,
) {
const url = new URL(
`${auth.baseUrl}/creator/v2.1/bulk/${account_owner_name}/${app_link_name}/report/${report_link_name}/read/${job_ID}/result`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Zoho-oauthtoken " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 235 days ago