projectdoc Toolbox

Runs a bulk update based on a uploaded file. The information will patch existing files and create new ones.

Parent
Type
Extension
Since
6.1
Path
rest/projectdoc/1/service/csv-table
HTTP Method
POST

The service is intended to accept column based input with metadata being provided as parameters to the REST service call.

Each line in the comma-separated values (CSV) file is defining one document. If it exists, it will be patched, if not it will be created.

Only values of existing properties and existing sections will be replaced. In case a property name or section title is encountered that cannot be matched to an existing property or section, the referenced document is not updated.

Backup your Data!

 

There is no undo!

It is strongly recommended to run commands only on backed-up instances!

Make a backup of your data before starting to work with this API! Consider to run your experiments on a copy of the production data!

Parameters

The following parameters are supported.

doctype

The identifier of the doctype for all documents described in the CSV file.

space-key

The key to the space where the new document will be stored.

If the space key is specified it will be a constraint on searching the document. In case there are two documents with the same name and doctype, the space key can be used to identify the intended document.

location

The location within the space that defines the parent page.

Either provide

  • the title of the page (not the name of the document),
  • the page identifier surrounded by curly braces (e.g.{123456}, the value of  space-key  is not taken into account in this case), or
  • the keyword {homepage} (to store the document to the doctype's homepage).

If the page title starts with a curly brace ({) and ends with one (}), you need to escape it with a backslash ( \) as in \{My Page Title}.

section-names

A comma-separated list of names used as column headers in the CSV file that refer to sections.

Every column header not found in this list is considered to be a property.

new-version

 Flag to control whether a new version should be created. If set to false, the document is saved without creating a new version. Defaults to true to create a new version.

The parameter is available since version 1.2.

comment

 The optional comment for the version. If no new version is created, the current comment is overridden.

The parameter is available since version 1.2.

csv-format

Provides some control over which format the CSV file is adhering to.

FormatDescription
projectdoc-csv

Delimited by comma (columns), using backslash as escape and double quotes to quote.

This is the default format.

projectdoc-excelAs projectdoc-csv, but uses the semicolon as delimiter.

Note that the first line is always considered to be the heading row.


Resources

CSV Update Service
Runs an update on a single projectdoc document based on an uploaded file. The information will patch the existing document or create a new one if the document does not exist.