Creating documents
Mandatory parameters
When creating a document, the following JSON body parameters must be send:
input: the UUID of the space or folder where you want to create the document. This parameter doesn't have to be specified when using the destination parameter.
params:
- type: The "name" of the form.
properties:
- dc:title: title of the document
IMPORTANT
Field values are not validated by the API. So, validation will have to be performed from the third-party app we want to integrate.
Optional params
params:
- checkDuplicated: It can be "True" or "False". If "True", it checks if the document already exists from the fields that have been marked as "unique". If the document exists, it returns a 500 error containing among its parameters the UUID of the already existing document. If the document does not exist, it creates it normally.
- autovalidate: It can be "True" or "False". When "True", it automatically marks the document as Validated.
Creating documents within folders or folder forms
You can also create documents within normal folders or form folders.
To do so, in the Input parameter, indicate the UUID of the parent folder or form.
Remember you can get this UUID from the view of the document (folder or form folder) as shown below.
For more information about folders and form folders, we recommend to check out:
Creating documents in a specific path
In some cases, we will need to create a document in a specific path. You can use the "destination" parameter to do so.
params:
- destination: it is the path where you want to create the document. The first part of this path is the space API name. In the case of the example "Customers_cdv". The rest of the path is built with the titles of the folders.
In the following example, we want to create a document in the space "Customers_cdv", within the folder North/Chicago.
Please note that in this case, it will not be necessary to indicate the param "input".
0 comments