Edits history of script submission #231 for ' Get File Public URL (hubspot)'

  • deno
    import { Client } from "npm:@hubspot/api-client@^8.1.0";
    
    type Hubspot = {
      token: string;
    };
    export async function main(
      auth: Hubspot,
      file_id: string,
      size?: "" | "thumb" | "icon" | "medium" | "preview",
      expiration_seconds?: number,
      upscale?: boolean,
    ) {
      const client = new Client({
        accessToken: auth.token,
      });
    
      try {
        return await client.files.filesApi.getSignedUrl(
          file_id,
          size || undefined,
          expiration_seconds || undefined,
          upscale || undefined,
        );
      } catch (e) {
        throw Error(`
          ${e.code}\n
          Message: ${e.body.message || e.body}\n
        `);
      }
    }
    

    Submitted by hugo697 399 days ago

  • deno
    import { Client } from "npm:@hubspot/api-client@^8.1.0";
    
    type Hubspot = {
      token: string;
    };
    export async function main(
      auth: Hubspot,
      file_id: string,
      size?: "" | "thumb" | "icon" | "medium" | "preview",
      expiration_seconds?: number,
      upscale?: boolean,
    ) {
      const client = new Client({
        accessToken: auth.token,
      });
    
      try {
        return await client.files.filesApi.getSignedUrl(
          file_id,
          size || undefined,
          expiration_seconds || undefined,
          upscale || undefined,
        );
      } catch (e) {
        throw Error(`
          ${e.code}\n
          Message: ${e.body.message || e.body}\n
        `);
      }
    }
    

    Submitted by admin 1031 days ago

  • deno
    import { Client } from "npm:@hubspot/api-client@^8.1.0"
    
    type Hubspot = {
      token: string;
    };
    export async function main(
      auth: Hubspot,
      file_id: string,
      size?: "" | "thumb" | "icon" | "medium" | "preview",
      expiration_seconds?: number,
      upscale?: boolean
    ) {
      const client = new Client({
        accessToken: auth.token
      })
    
      try {
        return await client.files.filesApi.getSignedUrl(
          file_id,
          size || undefined,
          expiration_seconds || undefined,
          upscale || undefined,
        )
      } catch (e) {
        throw Error(`
          ${e.code}\n
          Message: ${e.body.message || e.body}\n
        `)
      }
    }
    

    Submitted by admin 1034 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    import { Client } from "npm:@hubspot/api-client@^8.1.0"
    
    export async function main(
      auth: wmill.Resource<"hubspot">,
      file_id: string,
      size?: "" | "thumb" | "icon" | "medium" | "preview",
      expiration_seconds?: number,
      upscale?: boolean
    ) {
      const client = new Client({
        accessToken: auth.token
      })
    
      try {
        return await client.files.filesApi.getSignedUrl(
          file_id,
          size || undefined,
          expiration_seconds || undefined,
          upscale || undefined,
        )
      } catch (e) {
        throw Error(`
          ${e.code}\n
          Message: ${e.body.message || e.body}\n
        `)
      }
    }
    

    Submitted by adam186 1163 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    import { Client } from "npm:@hubspot/api-client@^8.1.0"
    
    export async function main(
      auth: wmill.Resource<"hubspot">,
      file_id: string,
      size?: "" | "thumb" | "icon" | "medium" | "preview",
      expiration_seconds?: number,
      upscale?: boolean
    ) {
      const client = new Client({
        accessToken: auth.token
      })
    
      try {
        return await client.files.filesApi.getSignedUrl(
          file_id,
          size || undefined,
          expiration_seconds || undefined,
          upscale || undefined,
        )
      } catch (e) {
        throw Error(`
          ${e.code}\n
          Message: ${e.body.message || e.body}\n
        `)
      }
    }
    

    Submitted by adam186 1198 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    import { Client } from "npm:@hubspot/api-client@^8.1.0"
    
    export async function main(
      auth: wmill.Resource<"hubspot">,
      file_id: string,
      size?: "" | "thumb" | "icon" | "medium" | "preview",
      expiration_seconds?: number,
      upscale?: boolean
    ) {
      const client = new Client({
        accessToken: auth.token
      })
    
      try {
        return await client.files.filesApi.getSignedUrl(
          file_id,
          size || undefined,
          expiration_seconds || undefined,
          upscale || undefined,
        )
      } catch (e) {
        throw Error(`
          ${e.code}\n
          Message: ${e.body.message || e.body}\n
        `)
      }
    }
    

    Submitted by adam186 1281 days ago