Documentation
¶
Overview ¶
Package anvil provides an interface to access the Anvil API
Index ¶
- Constants
- Variables
- type Anvil
- func (s *Anvil) CreateEtchPacket(payload interface{}) (etchPacketID string, err error)
- func (s *Anvil) DownloadDocuments(documentGroupEID string) (zip []byte, err error)
- func (s *Anvil) FillPDF(templateID, templateVersion string, payload interface{}) (pdf []byte, err error)
- func (s *Anvil) GenerateEtchSigningURL(signerEID, clientUserID string) (etchSigningURL string, err error)
- func (s *Anvil) GeneratePDF(payload interface{}) (pdf []byte, err error)
- type FillPDFPayload
- type GeneratePDFPayload
- type Logo
- type Page
Constants ¶
const TEMPLATE_VERSION_LATEST = -1
const TEMPLATE_VERSION_LATEST_PUBLISHED = -2
Variables ¶
var VERSION = ""
Functions ¶
This section is empty.
Types ¶
type Anvil ¶
type Anvil struct { APIKey string RESTAPIVersion string BaseURL string UserAgent string Logger *log.Logger // contains filtered or unexported fields }
func (*Anvil) CreateEtchPacket ¶
CreateEtchPacket creates an etch packet via a graphql mutation.
func (*Anvil) DownloadDocuments ¶
DownloadDocuments retrieves all completed documents in zip form.
func (*Anvil) FillPDF ¶
func (s *Anvil) FillPDF(templateID, templateVersion string, payload interface{}) (pdf []byte, err error)
FillPDF fills an existing template with provided payload data.
Use the casts graphql query to get a list of available templates you can use for this request.
By default, the request will use the latest published version. You can also use the constants `anvil.TEMPLATE_VERSION_LATEST_PUBLISHED` and `anvil.TEMPLATE_VERSION_LATEST` instead of providing a specific version number.
func (*Anvil) GenerateEtchSigningURL ¶
func (s *Anvil) GenerateEtchSigningURL(signerEID, clientUserID string) (etchSigningURL string, err error)
GenerateEtchSigningURL generates a signing URL for a given user.
func (*Anvil) GeneratePDF ¶
GeneratePDF dynamically generates a new PDF with provided payload data. Useful for agreements, invoices, disclosures, or any other text-heavy documents.
By default, GeneratePDF will format data assuming it's in markdown.
HTML is another supported input type. This can be used by providing `"type": "html"` in the payload and making the `data` field a dict containing keys `"html"` and an optional `"css"`.
type FillPDFPayload ¶
type FillPDFPayload struct { Data map[string]interface{} `json:"data"` // optional Title *string `json:"title,omitempty"` FontFamily *string `json:"fontFamily,omitempty"` FontSize *int `json:"fontSize,omitempty"` TextColor *string `json:"textColor,omitempty"` UseInteractiveFields *bool `json:"useInteractiveFields,omitempty"` }
type GeneratePDFPayload ¶
type GeneratePDFPayload struct { Data string `json:"data"` // optional Title *string `json:"title,omitempty"` Type *string `json:"type,omitempty"` FontFamily *string `json:"fontFamily,omitempty"` FontSize *int `json:"fontSize,omitempty"` TextColor *string `json:"textColor,omitempty"` IncludeTimestamp *bool `json:"includeTimestamp,omitempty"` Logo *Logo `json:"logo,omitempty"` Page *Page `json:"page,omitempty"` }
type Page ¶
type Page struct { Margin *string `json:"margin,omitempty"` MarginTop *string `json:"marginTop,omitempty"` MarginBottom *string `json:"marginBottom,omitempty"` MarginLeft *string `json:"marginLeft,omitempty"` MarginRight *string `json:"marginRight,omitempty"` PageCount *string `json:"pageCount,omitempty"` Width *int `json:"width,omitempty"` Height *int `json:"height,omitempty"` }