(templates.directLink)
Create a direct link for a template
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: 4865.89,
});
// Handle the result
console.log(result);
}
run();
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: 4865.89,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateCreateTemplateDirectLinkRequestBody | ✔️ | 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. |
Promise<operations.TemplateCreateTemplateDirectLinkResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateCreateTemplateDirectLinkResponseBody | 400 | application/json |
errors.TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete a direct link for a template
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: 5459.07,
});
// Handle the result
console.log(result);
}
run();
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: 5459.07,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateDeleteTemplateDirectLinkRequestBody | ✔️ | 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. |
Promise<operations.TemplateDeleteTemplateDirectLinkResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateDeleteTemplateDirectLinkResponseBody | 400 | application/json |
errors.TemplateDeleteTemplateDirectLinkTemplatesDirectLinkResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Enable or disable a direct link for a template
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: 722.9,
enabled: true,
});
// Handle the result
console.log(result);
}
run();
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: 722.9,
enabled: true,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateToggleTemplateDirectLinkRequestBody | ✔️ | 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. |
Promise<operations.TemplateToggleTemplateDirectLinkResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateToggleTemplateDirectLinkResponseBody | 400 | application/json |
errors.TemplateToggleTemplateDirectLinkTemplatesDirectLinkResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |