Portant Portant Docs

Document

Overview

A Document resources represents the template configuration for

Fields

FieldTypeDescription
idStringThe ID of the document.
documentTypeStringThe type of document for this template. This will either be the value "GOOGLE_DOCS" or "GOOGLE_SLIDES" depending on the file that is selected.
fileGoogle FileThe Google File that is a template document within the workflow. This file will be copied to create the output document.
outputNameStringA templated string used to generate the name for the output created from this template.
createPDFCopyBooleanA flag to enable creating a PDF copy of the output document.
removeOutputBoleanA flag to enable removing the original output document (Google Docs/Slides) files after a PDF copy has been made.
enablePdfPasswordBooleanA flag to enable pdf encryption of the created PDF.
pdfPasswordStringA templated string used to generate the password for the PDF. Only used if the `enablePdfPassword` flag is enabled.
PdfPasswordPreventCopyBooleanA flag to prevent content of the PDF being copied when the PDF is protected with a password.
previewUrlStringA url to the embedded editor used for non-Portant users changes to this document using source fields. It is assumed these users can access the associated Google File.

NOTE: This feature has not yet been implemented and my be subject to change.

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

Status Body
200 OK Array<Document>
403 Unauthorised Error

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

Status Body
201 Created Document
400 Bad Request Error
403 Unauthorised Error

Get a Document

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

Retrieve a specific document of a specific workflow.

Responses

Status Body
200 OK Document
403 Unauthorised Error

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

Status Body
200 OK Document
400 Bad Request Error
403 Unauthorised Error
⌘I