Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: REST-API-Examples > Practical examples > Archive (JobArchive)

Search document and list properties

Scroll Prev Top Next More

If you want to search for specific documents by using index data, use the GET route /application/jobarchive/archives/:archive/index. For this, the index fields are indicated with search values and operators in the where parameter.

Examples

URL for the search for a specific document revision

/application/jobarchive/archives/MYTESTARCHIVE/index

    ?where[revisionId][eq]=1032

URL for the search by index fields

/application/jobarchive/archives/MYTESTARCHIVE/index

    ?where[document_type][eq]=note&where[department][eq]=accounting

 

/application/jobarchive/archives/MYTESTARCHIVE/index

    ?where[amount][gt]=10000&where[amount][lt]=400000

 

/application/jobarchive/archives/MYTESTARCHIVE/index

    ?where[tags][in]=Finance,Accounting

If it is a list filed, use the option value as search value.

Response

The meta data of the documents found are returned in JSON format in the response. In the chapter Retrieve document you will find how to get the content of the document files.

{

    "archivedocuments": [

        {

            "revisionId": "4110",

            "deleteDate": "",

            "locked": false,

            "createDate": "2017-03-13T15:27:15+02:00",

            "createdBy": "jdoe",

            "modifyDate": "2017-03-13T15:27:15+02:00",

            "modifiedBy": "jdoe",

            "indexFields": [

                {

                    "name": "document_type",

                    "value": "note"

                },

                ... further index data

            ],

            "files": [

                {

                    "pageCount": 40,

                    "extension": "pdf",

                    "fileName": "my_document.pdf",

                    "filesize": 1024513

                },

                ... further files

            ]

        },

        ... further documents

    ]

}

Please note: The route delivers only the current document versions. If an outdated revision is requested, an empty response is returned.

Document attribute

Explanation

revisionId

Revision-ID

deleteDate

Planned deletion date

locked

States, if the document is locked (true,false)

createDate

Date of creation

createdBy

Who archived the document (username)

modifyDate

Date of the last modification

modifiedBy

Who modified the document (username)

indexFields

Index data (name and value)

files

Name, size, number of pages and extension of the document file

If you need an additional version, document attribute or the assigned keywords, use the GET route /application/jobarchive/archives/:archive/documents. This route displays the following data:

{

    "archivedocuments": [

        {

            "revisionId": "5367",

            "baseRevisionId": "5360",

            "archiveName": "INVOICES",

            "archiveGuid": "5F5AD1BE-352C-4B76-804C-5F3B79DA3A61",

            "createDate": "2017-05-10T10:28:31+02:00",

            "createdBy": "jdoe",

            "modifyDate": "2017-05-10T10:28:31+02:00",

            "modifiedBy": "jdoe",

            "lockDate": "",

            "lockedBy": null,

            "indexDataModifyDate": "2017-05-10T10:28:31+02:00",

            "indexDataModifiedBy": "jdoe",

            "deleteDate": "",

            "deleted": false,

            "trunk": true,

            "locked": false,

            "indexFields": [

                {

                    "name": "document_type",

                    "value": "incoming_invoice",

                    "type": "varchar",

                    "label": "",

                    "hasList": true

                },

                ... further index fields

            ],

            "keywordFields": [

                {

                    "name": "tags",

                    "keywords": [ "Inbox", "Invoice" ],

                    "type": "keyword"

                },

                ... further keywords

            ],

            "files": [

                {

                    "pageCount": 16,

                    "filesize": 30370,

                    "mimetype": "application/pdf",

                    "fileName": "invoice_239847.pdf",

                    "extension": "pdf",

                    "ordernum": 1

                },

                ... further files

            ]

        },

        ....

]}

With the documents route you can e.g. determine the versions of a document. Herefore, the attribute baserevision_id is filtered:

/application/jobarchive/archives/MYTESTARCHIVE/index

    ?where[baserevision_id][eq]=1234

Attribute

Explanation

baseRevisionId

ID of the first document version

archiveName

Name of the archive table

archiveGuid

GUID of the archive

lockDate

Date, when the document was locked

lockedBy

Who locked the document (username)

indexDataModifyDate

Date of the last index data modification

indexDataModifiedBy

Who changed the index data (username)

deleted

Flag, if the document was deleted (if no irreversible delete was set for the archive)

trunk

Flag, if this is the current version (true = current version)

indexFields

Here, additionally the type, the translated name and the flag, if it is a list field, are returned.

keywordFields

List of assigned keywords.

files

Additional mime type and order index of the document file