DocumentsApi

All URIs are relative to /api

MethodHTTP requestDescription
_deleteDELETE /documents/{lookup}Delete document(s) by name
listGET /documentsList documents
retrieveGET /documents/{key}Download a document

_delete

_delete(lookup)

Delete document(s) by name

Deletes generated PDF documents by name, all documents with this name are deleted.

Example

import {
  Configuration,
  DocumentsApi,
} from '@pdf-generator/client';
import type { DeleteRequest } from '@pdf-generator/client';

async function example() {
  console.log("🚀 Testing @pdf-generator/client SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: api-key
    apiKey: "YOUR API KEY",
  });
  const api = new DocumentsApi(config);

  const body = {
    // string | Document filename
    lookup: lookup_example,
  } satisfies DeleteRequest;

  try {
    const data = await api._delete(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

NameTypeDescriptionNotes
lookupstringDocument filename[Defaults to undefined]

Return type

void (Empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
204Document deleted-
404Document not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

ListDocumentsResponseDto list(startOffset, limit, nameFilter, template, start)

List documents

List generated PDF documents for the organization with pagination and optional filtering.

Example

import {
  Configuration,
  DocumentsApi,
} from '@pdf-generator/client';
import type { ListRequest } from '@pdf-generator/client';

async function example() {
  console.log("🚀 Testing @pdf-generator/client SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: api-key
    apiKey: "YOUR API KEY",
  });
  const api = new DocumentsApi(config);

  const body = {
    // string | Pagination offset (0-based), use the startOffset from the previous response (optional)
    startOffset: 0,
    // number | Maximum number of documents to return (default 100) (optional)
    limit: 100,
    // string | Partial match filter on document name (optional)
    nameFilter: invoice,
    // number | Filter by template ID (optional)
    template: 1,
    // any | Pagination offset (0-based) (optional)
    start: ...,
  } satisfies ListRequest;

  try {
    const data = await api.list(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

NameTypeDescriptionNotes
startOffsetstringPagination offset (0-based), use the startOffset from the previous response[Optional] [Defaults to undefined]
limitnumberMaximum number of documents to return (default 100)[Optional] [Defaults to undefined]
nameFilterstringPartial match filter on document name[Optional] [Defaults to undefined]
templatenumberFilter by template ID[Optional] [Defaults to undefined]
startanyPagination offset (0-based)[Optional] [Defaults to undefined]

Return type

ListDocumentsResponseDto

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieve

Blob retrieve(key, dl)

Download a document

Download a generated PDF document by its filename key.

Example

import {
  Configuration,
  DocumentsApi,
} from '@pdf-generator/client';
import type { RetrieveRequest } from '@pdf-generator/client';

async function example() {
  console.log("🚀 Testing @pdf-generator/client SDK...");
  const config = new Configuration({ 
    // To configure API key authorization: api-key
    apiKey: "YOUR API KEY",
  });
  const api = new DocumentsApi(config);

  const body = {
    // string | Document filename key
    key: key_example,
    // string | Set to \"1\" to force download with Content-Disposition attachment header (optional)
    dl: dl_example,
  } satisfies RetrieveRequest;

  try {
    const data = await api.retrieve(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

NameTypeDescriptionNotes
keystringDocument filename key[Defaults to undefined]
dlstringSet to "1" to force download with Content-Disposition attachment header[Optional] [Defaults to undefined]

Return type

Blob

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/pdf, application/json

HTTP response details

Status codeDescriptionResponse headers
200-
404Document not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]