DocKing - ShipSaaS
Docking GitHub
  • DocKing from ShipSaaS
  • Architecture
  • Requirements
  • PDF Engines
    • Gotenberg
    • WkHTMLtoPDF
    • mPDF
  • Upgrade Notes
    • v1.4.0
    • v1.3.2
    • v1.3.1
    • v1.3.0
    • v1.2.0
    • v1.1.2
    • v1.1.1
    • v1.1.0
  • Usage
    • Basic
    • Endpoints
    • Webhook
    • Maintain IDs/Keys from Services
  • Getting Started
    • Environment Variables
    • Run on Local
      • Normal Run
      • Docker
    • Storage
    • Console UI
    • Document Template
      • Gotenberg's Metadata
      • wkHTMLtoPDF's metadata
      • mPDF's metadata
    • Templating Mode
    • Fonts
    • Octane / High-perf mode
    • Localization
  • Deployment
    • Linux VPS / Dedicated Server
    • Docker
Powered by GitBook
On this page
  • [GET] api/v1/document-templates
  • [GET] api/v1/document-templates/{uuid}
  • [POST] api/v1/document-templates
  • [PUT] api/v1/document-templates/{uuid}
  • [DELETE] api/v1/document-templates/{uuid}
  • [POST] api/v1/document-templates/{uuid}/pdfs
  • [POST] api/v1/document-templates/{uuid}/pdfs-async
  • [GET] api/v1/document-files
  • [POST] api/v1/document-files/{uuid}
  1. Usage

Endpoints

List built-in endpoints of DocKing

Restful APIs are ready to use to interact with DocKing 😎

[GET] api/v1/document-templates

Get a list of templates

Request params:

  • limit: default 20

  • page: default 1

Response:

{
    data: DocumentTemplate[],
    ...paginationInfo
}

[GET] api/v1/document-templates/{uuid}

Get a single template detail.

Response:

{
    data: DocumentTemplate,
}

[POST] api/v1/document-templates

Create a new template.

Body:

{
    "title": "title here",
    "category": "category here",
    "key": "unique identifier key here"
}

Response: 201 on OK, 422 on Validation Error

{
    "uuid": "...",
    "created": true
}

[PUT] api/v1/document-templates/{uuid}

Update an existing template.

Body:

{
    "title": "title here",
    "category": "category here",
    "key": "unique identifier key here",
    "template": "html template here",
    "default_variables": { object of default variable },
    "metadata": { obj of metadata }
}

Response: 200 on OK, 422 on Validation Error

{
    "uuid": "...",
    "updated": true
}

[DELETE] api/v1/document-templates/{uuid}

Delete a single template.

Response: 200 on OK

{
    "uuid": "...",
    "deleted": true
}

[POST] api/v1/document-templates/{uuid}/pdfs

Render a template with the given data and returns the PDF file URL.

  • Body

    • variables (JSON object or array)

    • metadata (JSON object)

  • Response

    • OK: 200 with URL.

    • ERROR:

      • 400 with message or outcome.

      • 422 for validation errors.

[POST] api/v1/document-templates/{uuid}/pdfs-async

Asynchronously render a new template.

  • Body

    • variables (JSON object or array)

    • metadata (JSON object)

    • webhook_url (REQUIRED), for render result notification

  • Response

    • OK: 200 with the outcome.

    • ERROR:

      • 422: for validation errors.

[GET] api/v1/document-files

Get a list of document files

Request params:

  • limit: default 20

  • page: default 1

Response:

{
    data: File[],
    ...paginationInfo
}

[POST] api/v1/document-files/{uuid}

Returns the single rendered pdf file

PreviousBasicNextWebhook

Last updated 1 year ago