Edits history of script submission #21652 for ' Get the Status of the Bulk Read Job (zoho)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type Zoho = {
      token: string;
      baseUrl: string;
    };
    /**
     * Get the Status of the Bulk Read Job
     * To get the details of a bulk read job performed previously.
     */
    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}`,
      );
    
      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.json();
    }
    

    Submitted by hugo697 235 days ago