Edits history of script submission #17350 for ' Get legal hold information (miro)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type Miro = {
      token: string;
    };
    /**
     * Get legal hold information
     * Retrieves information about a legal hold within a case for an organization. Required scope organization:cases:management Rate limiting Level 3 Enterprise Guard only This API is available only for Enterprise plan users with the Enterprise Guard add-on. You can only use this endpoint if you have both the Company Admin and eDiscovery Admin roles.
     */
    export async function main(
      auth: Miro,
      org_id: string,
      case_id: string,
      legal_hold_id: string,
    ) {
      const url = new URL(
        `https://api.miro.com//v2/orgs/${org_id}/cases/${case_id}/legal-holds/${legal_hold_id}`,
      );
    
      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