Create new document with content

POST https://{{host}}/athento/site/automation/Athento.DocumentCreate/

Creates a document within a certain space on Athento. This request only creates a document with its data but doesn't attach binary content to the created document.

Mandatory data

This web service requires at least:

  • Input
  • "params" -> "type"
  • "params" -> "properties" -> "dc:title"

Input

This request needs as an input the UUID of the space where you want to create the document. You can get this UUID from the URL of the Space on Athento.

https:{{host}}/series/navigation/aef79721-db02-4be9-982a-dfee13af63fa

You can also use as input the space API name, which you will find in the Information tab of the Space from the UI.

https://{{host}}/series/view/{{space uuid}}/information/

Params

Type

In type you can indicate the Form you want to use for the new document. Use the API name of the form.

You can find the API name from the Configuration tab of the form.

https://{{host}}/doctypes/view/{{form-uuid}}/info/

Audit

Use the audit param to send information about the request, for example, who is the user logged in the third-party application that is trying to create the document.

ExtractValue

Use the extractValue param in case you need to obtain the value of a set of fields in the response after document creation. This is useful for example, when working with autoincrement fields used as document identifiers for business users.

If you use this param, you must add the key X-Fetch-Mode with value extended to the header of the request.

This param is list.

Properties

In the properties section, you can add a title for your document and values for your files.

Use dc:title to indicate a title for your new doc.

Field values are sent also as properties. For each field value, you want to populate in the new document, you need to send:

"API field name": "Field value"

You can find the API name of your fields from the Fields tab of your form.

https://{{host}}/doctypes/view/{{form uui}}/fields/

Be aware:
Athento's API doesn't check if a field has been set as mandatory. So the third-party app to integrate must apply all the desired restrictions.

Request Body

{"input"=>"aef79721-db02-4be9-982a-dfee13af63fa", "params"=>{"type"=>"my-form_jcm", "audit"=>"Document created from API", "properties"=>{"dc:title"=>"Document created from API", "my-form_jcm_field_1"=>"Field 1.", "my-form_jcm_field_2"=>"Field 2.", "my_json_field"=>{"keyA"=>"valueA", "keyB"=>"valueB"}, "my_itable_field"=>[{"DT_RowId"=>"row1", "itable-field-text-name"=>"Text test 1", "itable-field-number-name"=>"10"}, {"DT_RowId"=>"row2", "itable-field-text-name"=>"Text test 2", "itable-field-number-name"=>"20"}]}}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
X-Fetch-Modestring

RESPONSES

status: Created

{"uid":"dca515f6-7021-4e7c-a4fe-4225438e46ba","repository":"default","isCheckedOut":true,"parentRef":"","path":"","isProxy":false,"title":"Sample content document from API","lastModified":"2021-07-01T12:13:33.774661Z","facets":[],"entity-type":"document","state":"pending","isVersion":false,"type":"My Form"}