Edits history of script submission #17359 for ' Get results for board export job (miro)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type Miro = {
      token: string;
    };
    /**
     * Get results for board export job
     * Retrieves the result of the board export job. The response provides more information about the board export job, such as the S3 link to the files created.Required scope boards:export Rate limiting Level 4 Enterprise only This API is available only for Enterprise plan users. You can only use this endpoint if you have the role of a Company Admin and eDiscovery is enabled in the Settings. You can request temporary access to Enterprise APIs using this form.
     */
    export async function main(auth: Miro, org_id: string, job_id: string) {
      const url = new URL(
        `https://api.miro.com//v2/orgs/${org_id}/boards/export/jobs/${job_id}/results`,
      );
    
      const response = await fetch(url, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + 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