Search document by form

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

This endpoint allows searching documents that meet the criteria of a specific query.

Params

PageSize

PageSize defines how many documents you want to get in each page of the results.

Page

Page show a specific page or results.

Query

Athento uses a language similar to SQL to built queries.

The general syntax of a query expression is:

SELECT |select-clause| FROM |from-clause| WHERE |where-clause|

Let's review each clause.

SELECT clause (Mandatory)

The SELECT clause is a comma-separated list of document properties or fields.

Some document properties are:

  • doctype: form of the document

  • extension: extension of the file.

  • content/length: size of the file

  • totalpages: number of pages of the document.

  • public_url: public URL to access the document (if enabled).

  • ecm:uuid Indicates the uuid of the document.

  • ecm:path: path of the document.

  • ecm:name

  • ecm:versionLabel

  • ecm:serie :space where the document is stored.

  • ecm:serie::uuid: uuid of the space where the document is stored.

  • ecm:filename: filename of the main file.

  • ecm:isTrashed

  • ecm:primaryType

  • ecm:currentLifeCycleState : current lifecycle state of the document.

  • ecm:valid

  • ecm:expired

  • ecm:parentId : uuid of the folderish document that contains the document.

  • ecm:hash : hash of the file.

  • ecm:state: processing state (finished, validated, pending, processing).

  • dc:title :Indicates the title of the document.

  • dc:title: title of the document.

  • dc:created: creation date of the document,

  • dc:author: author of the document.

  • dc:modified_date: last modification date.

Fields

Field values can be requested as columns in your Select clause.
Use the API name of fields in this clause.

Be aware
'*' is not supported since the search endpoint uses different providers.

FROM clause (Mandatory)

The FROM clause is a comma-separated list of forms. Use the API name of the form to retrieve documents using a specific form.

You can also use Documents in the FROM clause if you don't want to filter for a specific form.

WHERE clause (Optional)

The optional WHERE clause is a set of criteria or condition listed documents must meet.

The WHERE clause can be stated in different ways:

  • Properties |
    Operator | Values

Supported operators

  • =

  • AND

  • OR

  • < >

  • <= >=

  • LIKE

  • ILIKE

  • IN

Field values in the WHERE clause

  • Text fields: put them between ''

  • Date fields: use '' and the format of the date must be YYYY-DD-MM.

  • Number fields: do not use ''

Accessing to containers of documents (parent documents)

From a document, you can reach information about the folderish document that contains it. You can use this information in the WHERE clause.

WHERE metadata.contract_number = '21283234' AND parent:metadata.customer_code = '234234/2021"

Request Body

{"params"=>{"pageSize"=>20, "page"=>0, "query"=>"SELECT ecm:uuid, dc:title, metadata.my-form_jcm_field_1, metadata.my-form_jcm_field_2 FROM my-form_jcm WHERE metadata.my-form_jcm_field_1 = 'Field 1 Update.' AND metadata.my-form_jcm_field_2 = 'Field 2 Update.'"}}

RESPONSES

status: OK

{&quot;isNextPageAvailable&quot;:true,&quot;hasError&quot;:false,&quot;pageSize&quot;:20,&quot;errorMessage&quot;:null,&quot;resultsCount&quot;:1,&quot;entries&quot;:[{&quot;ecm:uuid&quot;:&quot;a7e7c74c-ca91-41d0-9f47-c4960ed99b13&quot;,&quot;dc:title&quot;:&quot;Document update with API&quot;,&quot;metadata.my-form_jcm_field_2&quot;:&quot;Field 2 Update.&quot;,&quot;metadata.my-form_jcm_field_1&quot;:&quot;Field 1 Update.&quot;}],&quot;isLastPageAvailable&quot;:true,&quot;currentPageIndex&quot;:0,&quot;numberOfPages&quot;:1,&quot;entity-type&quot;:&quot;recordSet&quot;,&quot;isPreviousPageAvailable&quot;:false,&quot;currentPageSize&quot;:20,&quot;isSortable&quot;:true,&quot;isPaginable&quot;:true,&quot;maxPageSize&quot;:1000000}