Skip to content

Latest commit

 

History

History
538 lines (397 loc) · 41 KB

README.md

File metadata and controls

538 lines (397 loc) · 41 KB

Recipients

(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: 237.59,
  });

  // 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: 237.59,
  });

  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.RecipientGetDocumentRecipientResponseBody>

Errors

Error Type Status Code Content Type
errors.RecipientGetDocumentRecipientResponseBody 400 application/json
errors.RecipientGetDocumentRecipientDocumentsRecipientsResponseBody 404 application/json
errors.RecipientGetDocumentRecipientDocumentsRecipientsResponseResponseBody 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: "Haylie_Bernhard95@yahoo.com",
      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: "Haylie_Bernhard95@yahoo.com",
      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.RecipientCreateDocumentRecipientRequestBody ✔️ 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.RecipientCreateDocumentRecipientResponseBody>

Errors

Error Type Status Code Content Type
errors.RecipientCreateDocumentRecipientResponseBody 400 application/json
errors.RecipientCreateDocumentRecipientDocumentsRecipientsResponseBody 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: "Demetrius.Sanford35@hotmail.com",
        name: "<value>",
        role: "VIEWER",
      },
      {
        email: "Lyla50@yahoo.com",
        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: "Demetrius.Sanford35@hotmail.com",
        name: "<value>",
        role: "VIEWER",
      },
      {
        email: "Lyla50@yahoo.com",
        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.RecipientCreateDocumentRecipientsRequestBody ✔️ 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.RecipientCreateDocumentRecipientsResponseBody>

Errors

Error Type Status Code Content Type
errors.RecipientCreateDocumentRecipientsResponseBody 400 application/json
errors.RecipientCreateDocumentRecipientsDocumentsRecipientsResponseBody 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.RecipientUpdateDocumentRecipientRequestBody ✔️ 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.RecipientUpdateDocumentRecipientResponseBody>

Errors

Error Type Status Code Content Type
errors.RecipientUpdateDocumentRecipientResponseBody 400 application/json
errors.RecipientUpdateDocumentRecipientDocumentsRecipientsResponseBody 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.RecipientUpdateDocumentRecipientsRequestBody ✔️ 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.RecipientUpdateDocumentRecipientsResponseBody>

Errors

Error Type Status Code Content Type
errors.RecipientUpdateDocumentRecipientsResponseBody 400 application/json
errors.RecipientUpdateDocumentRecipientsDocumentsRecipientsResponseBody 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.RecipientDeleteDocumentRecipientRequestBody ✔️ 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.RecipientDeleteDocumentRecipientResponseBody>

Errors

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