Edits history of script submission #21456 for ' Get Applications (zoho)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type Zoho = {
      token: string;
      baseUrl: string;
    };
    /**
     * Get Applications
     * This API fetches the meta information of all the applications that you have access to.
     */
    export async function main(auth: Zoho) {
      const url = new URL(`${auth.baseUrl}/creator/v2.1/meta/applications`);
    
      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