Document

Overview

A Document resources represents the template configuration for

Fields

Example

{
    "id": "doc_5LGGqC5S78RNS0",
    "documentType": "GOOGLE_DOCS",
    "file": {
        "id": "1uNfBHAKhcgRsiftb7xRpTJRS0k9LY1iX1gUnTOE0zU4",
        "name": "Complete Workflow Please - [Template]",
        "url": "https://docs.google.com/document/d/1uNfBHAKhcgRsiftb7xRpTJRS0k9LY1iX1gUnTOE0zU4/edit?usp=drivesdk",
        "mimeType": "application/vnd.google-apps.document"
    },
    "outputName": "Document for {{First Name}}",
    "createPdfCopy": true,
    "removeOutput": false,
    "enablePdfPassword": false,
    "pdfPassword": "Password-{{Secret Number}}",
    "pdfPasswordPreventCopy": false,
    "previewUrl": "https://preview.portant.co/doc_5LGGqC5S78RNS0"
}

Endpoints

List all Documents for a Workflow

GET /workflows/<wkf_id>/documents/

List all documents of the specific workflow as specified by the id.

Responses

Create a Document for a Workflow

POST /workflows/<wkf_id>/documents/

Create a new document for the specified workflow.

Request

A create Document object as JSON.

The payload may contain an optional file_id field with a file ID for a file in Google Drive that the requesting user has access to.

{
    file_id?: "1uNfBHAKhcgRsiftb7xRpTJRS0k9LY1iX1gUnTOE0zU4"
}

Alternatively, the file_id can be omitted in order to create a new document.

Responses

Get a Document

GET /workflows/<wkf_id>/documents/<doc_id>/

Retrieve a specific document of a specific workflow.

Responses

Update a Document

PATCH /workflows/<wkf_id>/documents/<doc_id>/

Update a specific document as specified by its id.

Request

A partial Document object as JSON.

The payload may contain an of the editable fields of the document. Note, the selected file for a document can not be changed once it is created.

{
    "outputName"?: "New outputName for {{First Name}}",
    "pdfPassword"?: "NewPassword-{{Secret Number}}",
    "enablePdfPassword"?: true,
    "enablePdfPreventCopy"?: true,
}

Responses

Last updated