Document management

This section specifically only talks about documents that are stored in the Vizzlo Cloud. For other cloud storage providers, please see Cloud Storage.

Listing documents and folders

To list the contents of a users’ folders, the following two actions can be used.

Routes
Query parameters
NameTypeDescription
offset (optional)numberSkips this number of results
limit (optional)numberLimits number of results to this value (default: 10)
match (optional)stringMatches against folder and document titles
Example

The result is a JSON object, looking roughly like this:

{
  "offset": 0,
  "limit": 10,
  "count": 123,
  "match": "blabalbal",
  "results": [
    {
      "type": "folder",
      "folder": {
        // …
      },
      "urls": {
        "view": "https://vizzlo.com/…",
        "endpoint": "https://vizzlo.com/api/v1/…"
      }
    },
    {
      "type": "document",
      "document": {
        // …
      },
      "urls": {
        "view": "https://vizzlo.com/…",
        "endpoint": "https://vizzlo.com/api/v1/…",
        "thumbnail": "https://vizzlo.com/…/.png"
      }
    }
  ]
}

Downloading documents

Getting the JSON representation of a document

Route

GET /api/v1/users/id/documents/doc

Optional query parameters valid for this action

Getting layouted, renderend, or rastered representations of a document

Routes

Creating documents

Route

POST /api/v1/create-document

This endpoint is used to create a new document in the current user’s private space or any team folder they are a member of. The JSON payload needs to contains all necessary information to know where and what kind of document to create.

Payload
Returns

Upon success, a JSON object with two fields is returned:

Examples

Document actions

Route

POST /api/v1/users/id/documents/doc

This endpoint is used to trigger document-specific actions on the platform. The action is send as parameter action of the JSON payload of the request.

Closing a document

When a document is closed on the client side, a “close” action should be performed, to trigger generating an up-to-date thumbnail, etc. of the document.

Payload
{
  "action": "close"
}
Returns

No content upon success.

Forking an existing document

Also known as “Duplicate document” or “Make a copy” functionality, this action will create a fork of the document in the same folder (if the current user has write rights to that folder) or in the current user’s root directory.

Payload
{
  "action": "fork"
}
Returns

Modifying documents

Updating an existing document

Allows you to update all content of an existing Vizzlo document. Most prominently, you might want to change the (Vizzard-specific) data and settings fields.

Route

PUT /api/v1/users/id/documents/doc

Payload
{
  "plugin_id": "XXXXXXXXXXXXXXXXXXXXXX",
  "settings": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  },
  "data": [
    {
      "key1": "value1",
      "key2": "value2",
      "key3": "value3"
    },
    {
      "key1": "value1",
      "key2": "value2",
      "key3": "value3"
    }
  ],
  "title": "My Vizzlo document",
  "theme": "business-blue",
  "custom_theme": {
    "TBD": "TBD"
  },
  "style": {
    "no_title": false,
    "no_branding": false,
    "subtitle": "My document's <u>subtitle</u>",
    "footer": "Footer content <b>HTML</b>",
    "annotations": [
      {
        "": ""
      }
    ],
    "description": "This document's meta description.",
    "width": 960,
    "height": 540,
    "margin": [
      {
        "": ""
      }
    ]
  }
}
Returns
{
  "path": "/d/XXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "1234567890",
  "urls": {
    "endpoint": "/api/v1/users/XXXXXXXXXXXXX/documents/XXXXXXXXXXXXXXXXXXXXXX",
    "document_view": "https://vizzlo.com/d/XXXXXXXXXXXXXXXXXXXXXX",
    "parent_folder": "https://vizzlo.com/documents/XXXXXXXX/XXXXXXXXXXXXXXXXXXX",
    "parent_folder_title": "Bakery Project"
  }
}

Moving or renaming existing documents

Route
Payload

The JSON payload for this PATCH request allows moving a document to a different folder (optionally in a different account) and/or renaming it:

{
  "folder": "/XXXXXXXX/XXXXXXXXXXXXXXXXXXX",
  "owner": "XXXXXXXXXXXXX",
  "title": "XXX XXXXXXXXX XXXXXXXX"
}
Returns
{
  "path": "/d/XXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "1234567890"
}

Adding a new record to an existing document

Allows you to add a single new records to the data of an existng document without changing anything else.

Route
Payload

TBD

Returns

TBD

Deleting documents

Route

DELETE /api/v1/users/id/documents/doc

Returns

No content upon success.

Restoring documents from trash bin

Route

POST /api/v1/users/id/documents/doc

Payload
{
  "action": "restore"
}
Returns

No content upon success.

Expunging documents from trash bin

Route

DELETE /api/v1/users/id/documents/doc?expunge=1

Returns

No content upon success.

Working with folders

Routes

Duplicating folders

Route

POST /api/v1/users/id/folders/*path

Payload
{
  "action": "duplicate"
}
Returns

A JSON object is returned which contains the following fields:

Deleting folders

Route

DELETE /api/v1/users/id/folders/*path

Returns

No content upon success.

Restoring folders from trash bin

Route

POST /api/v1/users/id/folders/*path

Payload
{
  "action": "restore"
}
Returns

No content upon success.

Expunging folders from trash bin

The folder and all its contents will permanently be deleted from the system.

Route

DELETE /api/v1/users/id/folders/*path?expunge=1

Returns

No content upon success.

Sharing documents and folders

The access control list (ACL) of documents and folders (see acl property when GETting folder or documents) can be modified by POSTing or DELETEing single access control entries.

Routes

A request object always contains these properties:

When creating new (POST) or updating existing (PATCH) access control entries, the result of this request will always the full access control entry (ACE). In case of a successful DELETE request, HTTP 204 No Content will be returned.

Based on the additional properties, these are the different types of sharing requests you can make:

Sharing with Vizzlo users

Sharing with external users (by email address)

A unique token will be generated that is sent by mail. Should the recipient already have a Vizzlo account, they will just be logged into their account by clicking the link and be added to the ACL as a Vizzlo user.

If neither user_id, nor email is given, a sharing link is generated and returned as part of the ACE.

Examples:

  1. POST /api/v1/share

    {
      "owner": "qdjn7notricsy",
      "document": "T0g2oxgTQFaaONWDe4Spvw",
      "user_id": "rxv242bf5t7c2"
    }
    

    Will allow read access for Vizzlo user rxv242bf5t7c2 to qdjn7notricsy’s document T0g2oxgTQFaaONWDe4Spvw.

  2. DELETE /api/v1/share

    {
      "owner": "qdjn7notricsy",
      "document": "T0g2oxgTQFaaONWDe4Spvw",
      "user_id": "rxv242bf5t7c2"
    }
    

    Will revoke the access from example 1 again.

  3. POST /api/v1/share

    {
      "owner": "qdjn7notricsy",
      "document": "T0g2oxgTQFaaONWDe4Spvw"
    }
    

    Will create a sharing link with read access and return:

    {
      "mode": "r",
      "link": "https://vizzlo.com/share/qfWi7PKiTrChiSjwueFp3Q"
    }
    
  4. PATCH /api/v1/share

    {
      "owner": "qdjn7notricsy",
      "document": "T0g2oxgTQFaaONWDe4Spvw",
      "link": "https://vizzlo.com/share/qfWi7PKiTrChiSjwueFp3Q",
      "mode": "w"
    }
    

    Will upgrade the existing permission to write access and return the ACE.

    {
      "owner": "qdjn7notricsy",
      "document": "T0g2oxgTQFaaONWDe4Spvw",
      "link": "https://vizzlo.com/share/qfWi7PKiTrChiSjwueFp3Q",
      "mode": "w"
    }
    
  5. DELETE /api/v1/share

    {
      "owner": "qdjn7notricsy",
      "document": "T0g2oxgTQFaaONWDe4Spvw",
      "link": "https://vizzlo.com/share/qfWi7PKiTrChiSjwueFp3Q"
    }
    

    Will revoke the access from example 3 again.

Listing things shared with me

Routes
Route

GET /api/v1/search

Query parameters valid for this action
The result is a JSON object, looking roughly like this
{
  "offset": 0,
  "limit": 10,
  "count": 123,
  "query": "blabalbal",
  "results": [
    {
      "type": "folder",
      "folder": {
        // …
      },
      "urls": {
        "view": "https://vizzlo.com/…",
        "endpoint": "https://vizzlo.com/api/v1/…"
      }
    },
    {
      "type": "document",
      "document": {
        // …
      },
      "urls": {
        "view": "https://vizzlo.com/…",
        "endpoint": "https://vizzlo.com/api/v1/…",
        "thumbnail": "https://vizzlo.com/…/.png"
      }
    }
  ]
}