Skip to content

Latest commit

 

History

History
538 lines (397 loc) · 39.7 KB

File metadata and controls

538 lines (397 loc) · 39.7 KB

DocumentsRecipients

(documents.recipients)

Overview

Available Operations

  • get - Get document recipient
  • create - Create document recipient
  • createMany - Create document recipients
  • update - Update document recipient
  • updateMany - Update document recipients
  • delete - Delete document recipient

get

Returns a single recipient. If you want to retrieve all the recipients for a document, use the "Get Document" endpoint.

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.documents.recipients.get({
    recipientId: 7003.47,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsRecipientsGet } from "@documenso/sdk-typescript/funcs/documentsRecipientsGet.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 documentsRecipientsGet(documenso, {
    recipientId: 7003.47,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.RecipientGetDocumentRecipientRequest ✔️ 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.RecipientGetDocumentRecipientResponse>

Errors

Error Type Status Code Content Type
errors.RecipientGetDocumentRecipientBadRequestError 400 application/json
errors.RecipientGetDocumentRecipientNotFoundError 404 application/json
errors.RecipientGetDocumentRecipientInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

create

Create a single recipient for a document.

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.documents.recipients.create({
    documentId: 4865.89,
    recipient: {
      email: "[email protected]",
      name: "<value>",
      role: "CC",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsRecipientsCreate } from "@documenso/sdk-typescript/funcs/documentsRecipientsCreate.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 documentsRecipientsCreate(documenso, {
    documentId: 4865.89,
    recipient: {
      email: "[email protected]",
      name: "<value>",
      role: "CC",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.RecipientCreateDocumentRecipientRequest ✔️ 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.RecipientCreateDocumentRecipientResponse>

Errors

Error Type Status Code Content Type
errors.RecipientCreateDocumentRecipientBadRequestError 400 application/json
errors.RecipientCreateDocumentRecipientInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

createMany

Create multiple recipients for a document.

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.documents.recipients.createMany({
    documentId: 5158.41,
    recipients: [
      {
        email: "[email protected]",
        name: "<value>",
        role: "APPROVER",
      },
      {
        email: "[email protected]",
        name: "<value>",
        role: "APPROVER",
      },
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsRecipientsCreateMany } from "@documenso/sdk-typescript/funcs/documentsRecipientsCreateMany.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 documentsRecipientsCreateMany(documenso, {
    documentId: 5158.41,
    recipients: [
      {
        email: "[email protected]",
        name: "<value>",
        role: "APPROVER",
      },
      {
        email: "[email protected]",
        name: "<value>",
        role: "APPROVER",
      },
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.RecipientCreateDocumentRecipientsRequest ✔️ 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.RecipientCreateDocumentRecipientsResponse>

Errors

Error Type Status Code Content Type
errors.RecipientCreateDocumentRecipientsBadRequestError 400 application/json
errors.RecipientCreateDocumentRecipientsInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

update

Update a single recipient for a document.

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.documents.recipients.update({
    documentId: 8574.78,
    recipient: {
      id: 5971.29,
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsRecipientsUpdate } from "@documenso/sdk-typescript/funcs/documentsRecipientsUpdate.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 documentsRecipientsUpdate(documenso, {
    documentId: 8574.78,
    recipient: {
      id: 5971.29,
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.RecipientUpdateDocumentRecipientRequest ✔️ 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.RecipientUpdateDocumentRecipientResponse>

Errors

Error Type Status Code Content Type
errors.RecipientUpdateDocumentRecipientBadRequestError 400 application/json
errors.RecipientUpdateDocumentRecipientInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

updateMany

Update multiple recipients for a document.

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.documents.recipients.updateMany({
    documentId: 4057.69,
    recipients: [
      {
        id: 5359.16,
      },
      {
        id: 8982.15,
      },
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsRecipientsUpdateMany } from "@documenso/sdk-typescript/funcs/documentsRecipientsUpdateMany.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 documentsRecipientsUpdateMany(documenso, {
    documentId: 4057.69,
    recipients: [
      {
        id: 5359.16,
      },
      {
        id: 8982.15,
      },
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.RecipientUpdateDocumentRecipientsRequest ✔️ 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.RecipientUpdateDocumentRecipientsResponse>

Errors

Error Type Status Code Content Type
errors.RecipientUpdateDocumentRecipientsBadRequestError 400 application/json
errors.RecipientUpdateDocumentRecipientsInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*

delete

Delete document recipient

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.documents.recipients.delete({
    recipientId: 5459.07,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsRecipientsDelete } from "@documenso/sdk-typescript/funcs/documentsRecipientsDelete.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 documentsRecipientsDelete(documenso, {
    recipientId: 5459.07,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.RecipientDeleteDocumentRecipientRequest ✔️ 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.RecipientDeleteDocumentRecipientResponse>

Errors

Error Type Status Code Content Type
errors.RecipientDeleteDocumentRecipientBadRequestError 400 application/json
errors.RecipientDeleteDocumentRecipientInternalServerError 500 application/json
errors.APIError 4XX, 5XX */*