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.
- Parent
- Type
- Extension
- Since
- 6.1
- Path
rest/projectdoc/1/service
/csv-document- HTTP Method
- POST
The service is intended to update a projectdoc document based on a CSV file. The CSV file provides properties and sections only for one document.
If the referenced document does not exist, it will be created. Otherwise the existing document is patched. The document is identified by the doctype and the name.
Each line in the comma-separated values (CSV) file is defining a property or section. The first column contains the property name or section title, the second column the property value or section body.
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.
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 ofspace-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.
Format | Description |
---|---|
projectdoc-csv | Delimited by comma (columns), using backslash as escape and double quotes to quote. This is the default format. |
projectdoc-excel | As projectdoc-csv , but uses the semicolon as delimiter. |
Note that the first line is always considered to be the heading row.
Resources
- CSV Bulk Update Service
- Runs a bulk update based on a uploaded file. The information will patch existing files and create new ones.