Edits history of script submission #216 for ' Get All Bounces (sendgrid)'

  • deno
    import sendgrid from "npm:@sendgrid/client@^7.7.0";
    
    /**
     * @param on_behalf_of The subuser's username. This header generates the
     * API call as if the subuser account was making the call.
     *
     * @param start_time The start of the time range in unix timestamp
     * when a bounce was created (inclusive).
     *
     * @param end_time The end of the time range in unix timestamp
     * when a bounce was created (inclusive).
     *
     * @param limit Limit the number of returned elements. Default is 500.
     *
     * @param offset Pagination.
     */
    type Sendgrid = {
      token: string;
    };
    export async function main(
      api_token: Sendgrid,
      on_behalf_of?: string,
      start_time?: number,
      end_time?: number,
      limit?: number,
      offset?: number,
    ) {
      sendgrid.setApiKey(api_token.token);
      const headers: Record<string, string> = { Accept: "application/json" };
      if (on_behalf_of) {
        headers["on-behalf-of"] = on_behalf_of;
      }
    
      const request = {
        url: `/v3/suppression/bounces`,
        method: "GET",
        headers,
        qs: {
          start_time,
          end_time,
          limit,
          offset,
        },
      };
    
      try {
        const [_, body] = await sendgrid.request(request);
        return body;
      } catch (error) {
        throw Error("\n" + JSON.stringify(error?.response?.body || error));
      }
    }
    

    Submitted by hugo697 395 days ago

  • deno
    import sendgrid from "npm:@sendgrid/client@^7.7.0";
    
    /**
     * @param on_behalf_of The subuser's username. This header generates the
     * API call as if the subuser account was making the call.
     *
     * @param start_time The start of the time range in unix timestamp
     * when a bounce was created (inclusive).
     *
     * @param end_time The end of the time range in unix timestamp
     * when a bounce was created (inclusive).
     *
     * @param limit Limit the number of returned elements. Default is 500.
     *
     * @param offset Pagination.
     */
    type Sendgrid = {
      token: string;
    };
    export async function main(
      api_token: Sendgrid,
      on_behalf_of?: string,
      start_time?: number,
      end_time?: number,
      limit?: number,
      offset?: number,
    ) {
      sendgrid.setApiKey(api_token.token);
      const headers: Record<string, string> = { Accept: "application/json" };
      if (on_behalf_of) {
        headers["on-behalf-of"] = on_behalf_of;
      }
    
      const request = {
        url: `/v3/suppression/bounces`,
        method: "GET",
        headers,
        qs: {
          start_time,
          end_time,
          limit,
          offset,
        },
      };
    
      try {
        const [_, body] = await sendgrid.request(request);
        return body;
      } catch (error) {
        throw Error("\n" + JSON.stringify(error?.response?.body || error));
      }
    }
    

    Submitted by admin 1028 days ago

  • deno
    import sendgrid from "npm:@sendgrid/client@^7.7.0"
    
    /**
     * @param on_behalf_of The subuser's username. This header generates the 
     * API call as if the subuser account was making the call.
     * 
     * @param start_time The start of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param end_time The end of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param limit Limit the number of returned elements. Default is 500.
     * 
     * @param offset Pagination.
     */
    type Sendgrid = {
      token: string;
    };
    export async function main(
      api_token: Sendgrid,
      on_behalf_of?: string,
      start_time?: number,
      end_time?: number,
      limit?: number,
      offset?: number
    ) {
      sendgrid.setApiKey(api_token.token);
      const headers: Record<string, string> = { "Accept": "application/json" }
      if(on_behalf_of) {
        headers['on-behalf-of'] = on_behalf_of
      }
    
      const request = {
        url: `/v3/suppression/bounces`,
        method: 'GET',
        headers,
        qs: {
          start_time,
          end_time,
          limit,
          offset
        }
      }
    
      try {
        const [_, body] = await sendgrid.request(request)
        return body
      } catch (error) {
        throw Error('\n' + (JSON.stringify(error?.response?.body || error)))
      }
    }
    

    Submitted by admin 1031 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    import sendgrid from "npm:@sendgrid/client@^7.7.0"
    
    /**
     * @param on_behalf_of The subuser's username. This header generates the 
     * API call as if the subuser account was making the call.
     * 
     * @param start_time The start of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param end_time The end of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param limit Limit the number of returned elements. Default is 500.
     * 
     * @param offset Pagination.
     */
    export async function main(
      api_token: wmill.Resource<"sendgrid">,
      on_behalf_of?: string,
      start_time?: number,
      end_time?: number,
      limit?: number,
      offset?: number
    ) {
      sendgrid.setApiKey(api_token.token);
      const headers: Record<string, string> = { "Accept": "application/json" }
      if(on_behalf_of) {
        headers['on-behalf-of'] = on_behalf_of
      }
    
      const request = {
        url: `/v3/suppression/bounces`,
        method: 'GET',
        headers,
        qs: {
          start_time,
          end_time,
          limit,
          offset
        }
      }
    
      try {
        const [_, body] = await sendgrid.request(request)
        return body
      } catch (error) {
        throw Error('\n' + (JSON.stringify(error?.response?.body || error)))
      }
    }
    

    Submitted by adam186 1159 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    import sendgrid from "npm:@sendgrid/client@^7.7.0"
    
    /**
     * @param on_behalf_of The subuser's username. This header generates the 
     * API call as if the subuser account was making the call.
     * 
     * @param start_time The start of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param end_time The end of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param limit Limit the number of returned elements. Default is 500.
     * 
     * @param offset Pagination.
     */
    export async function main(
      api_token: wmill.Resource<"sendgrid">,
      on_behalf_of?: string,
      start_time?: number,
      end_time?: number,
      limit?: number,
      offset?: number
    ) {
      sendgrid.setApiKey(api_token.token);
      const headers: Record<string, string> = { "Accept": "application/json" }
      if(on_behalf_of) {
        headers['on-behalf-of'] = on_behalf_of
      }
    
      const request = {
        url: `/v3/suppression/bounces`,
        method: 'GET',
        headers,
        qs: {
          start_time,
          end_time,
          limit,
          offset
        }
      }
    
      try {
        const [_, body] = await sendgrid.request(request)
        return body
      } catch (error) {
        throw Error('\n' + (JSON.stringify(error?.response?.body || error)))
      }
    }
    

    Submitted by adam186 1194 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    import sendgrid from "npm:@sendgrid/client@^7.7.0"
    
    /**
     * @param on_behalf_of The subuser's username. This header generates the 
     * API call as if the subuser account was making the call.
     * 
     * @param start_time The start of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param end_time The end of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param limit Limit the number of returned elements. Default is 500.
     * 
     * @param offset Pagination.
     */
    export async function main(
      api_token: wmill.Resource<"sendgrid">,
      on_behalf_of?: string,
      start_time?: number,
      end_time?: number,
      limit?: number,
      offset?: number
    ) {
      sendgrid.setApiKey(api_token.token);
      const headers: Record<string, string> = { "Accept": "application/json" }
      if(on_behalf_of) {
        headers['on-behalf-of'] = on_behalf_of
      }
    
      const request = {
        url: `/v3/suppression/bounces`,
        method: 'GET',
        headers,
        qs: {
          start_time,
          end_time,
          limit,
          offset
        }
      }
    
      try {
        const [_, body] = await sendgrid.request(request)
        return body
      } catch (error) {
        throw Error('\n' + (JSON.stringify(error?.response?.body || error)))
      }
    }
    

    Submitted by adam186 1282 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    import sendgrid from "npm:@sendgrid/client@^7.7.0"
    
    /**
     * @param on_behalf_of The subuser's username. This header generates the 
     * API call as if the subuser account was making the call.
     * 
     * @param start_time The start of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param end_time The end of the time range in unix timestamp 
     * when a bounce was created (inclusive).
     * 
     * @param limit Limit the number of returned elements. Default is 500.
     * 
     * @param offset Pagination.
     */
    export async function main(
      api_token: wmill.Resource<"sendgrid">,
      on_behalf_of?: string,
      start_time?: number,
      end_time?: number,
      limit?: number,
      offset?: number
    ) {
      sendgrid.setApiKey(api_token.token);
      const headers: Record<string, string> = { "Accept": "application/json" }
      if(on_behalf_of) {
        headers['on-behalf-of'] = on_behalf_of
      }
    
      const request = {
        url: `/v3/suppression/bounces`,
        method: 'GET',
        headers,
        qs: {
          start_time,
          end_time,
          limit,
          offset
        }
      }
    
      try {
        const [_, body] = await sendgrid.request(request)
        return body
      } catch (error) {
        throw Error('\n' + JSON.stringify(error?.response?.body || error))
      }
    }
    

    Submitted by adam186 1282 days ago