pandadoc
PandaDoc is a document automation software.
Usage
import { pandadoc } from 'netzo/apis/pandadoc.ts'
const api = pandadoc({
apiKey: Deno.env.get('PANDADOC_API_KEY')
})
Configuration
The pandadoc
factory function expects an object with the following, and returns an object with an API client api
.
Param | Type | Default | Description |
---|---|---|---|
apiKey | string | Deno.env.get('PANDADOC_API_KEY') | the api key to use for authentication |
Refer to the API documentation to get the required information.
Examples
The following examples assume you have created an api client instance.
Find documents
Find all documents that match the query.
const query: QueryDocuments = {}
const result = await api.documents.get<Documents>(query)
const resultData = result.results
Get document
Get all details of a document by id.
const resultData = await api.documents[DOCUMENT_ID].details.get<Document>()
Update document
Update a document by id.
const data: DataAddDocument = {
recipients: {
ID: RECIPIENT_ID,
first_name: 'John Doe'
}
}
const resultData = await api.documents[DOCUMENT_ID].patch<{}>(data)
Delete document
Delete a document by id.
await api.documents[DOCUMENT_ID].delete<void>()
Find contacts
Find all contacts associated with the workspace.
const result = await api.contacts.get<Contacts>()
const resultData = result.results
Add contact
Add a new contact.
const data: DataAddContact = { email: '[email protected]' }
const resultData = await api.contacts.post<Contact>(data)