Skip to content

Latest commit

 

History

History
242 lines (179 loc) · 20.8 KB

File metadata and controls

242 lines (179 loc) · 20.8 KB

Templates.DirectLink

Overview

Available Operations

create

Create a direct link for a template

Example Usage

import { Documenso } from "@documenso/sdk-typescript";

const documenso = new Documenso({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const result = await documenso.templates.directLink.create({
    templateId: 5094.31,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesDirectLinkCreate } from "@documenso/sdk-typescript/funcs/templatesDirectLinkCreate.js";

// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const res = await templatesDirectLinkCreate(documenso, {
    templateId: 5094.31,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("templatesDirectLinkCreate failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TemplateCreateTemplateDirectLinkRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TemplateCreateTemplateDirectLinkResponse>

Errors

Error Type Status Code Content Type
errors.TemplateCreateTemplateDirectLinkBadRequestError 400 application/json
errors.TemplateCreateTemplateDirectLinkUnauthorizedError 401 application/json
errors.TemplateCreateTemplateDirectLinkForbiddenError 403 application/json
errors.TemplateCreateTemplateDirectLinkInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

delete

Delete a direct link for a template

Example Usage

import { Documenso } from "@documenso/sdk-typescript";

const documenso = new Documenso({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const result = await documenso.templates.directLink.delete({
    templateId: 9950.03,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesDirectLinkDelete } from "@documenso/sdk-typescript/funcs/templatesDirectLinkDelete.js";

// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const res = await templatesDirectLinkDelete(documenso, {
    templateId: 9950.03,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("templatesDirectLinkDelete failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TemplateDeleteTemplateDirectLinkRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TemplateDeleteTemplateDirectLinkResponse>

Errors

Error Type Status Code Content Type
errors.TemplateDeleteTemplateDirectLinkBadRequestError 400 application/json
errors.TemplateDeleteTemplateDirectLinkUnauthorizedError 401 application/json
errors.TemplateDeleteTemplateDirectLinkForbiddenError 403 application/json
errors.TemplateDeleteTemplateDirectLinkInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

toggle

Enable or disable a direct link for a template

Example Usage

import { Documenso } from "@documenso/sdk-typescript";

const documenso = new Documenso({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const result = await documenso.templates.directLink.toggle({
    templateId: 6583.54,
    enabled: false,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesDirectLinkToggle } from "@documenso/sdk-typescript/funcs/templatesDirectLinkToggle.js";

// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
  apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});

async function run() {
  const res = await templatesDirectLinkToggle(documenso, {
    templateId: 6583.54,
    enabled: false,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("templatesDirectLinkToggle failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.TemplateToggleTemplateDirectLinkRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.TemplateToggleTemplateDirectLinkResponse>

Errors

Error Type Status Code Content Type
errors.TemplateToggleTemplateDirectLinkBadRequestError 400 application/json
errors.TemplateToggleTemplateDirectLinkUnauthorizedError 401 application/json
errors.TemplateToggleTemplateDirectLinkForbiddenError 403 application/json
errors.TemplateToggleTemplateDirectLinkInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*