This page provides an overview of APIs related to source documents.

Object Overview

Source documents contain metadata about processed objects and are stored inside of collections within Lexi.

Endpoint, URL, and Supported Methods

Source documents are managed via the Lexi server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/collections/[collection-guid]/documents

By default, the Lexi server is accessible on port 8201.

Supported methods include: GET HEAD PUT DELETE

Structure

Objects have the following structure:

{
    "GUID": "1fdbe0c8-8b85-4b0e-ac42-dd4757684a9f",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "CollectionGUID": "default",
    "ObjectGUID": "f615ac92-d1d1-4b46-8cc5-acf721131067",
    "ObjectKey": "5.pdf",
    "ObjectVersion": "1",
    "ContentType": "application/pdf",
    "DocumentType": "Pdf",
    "SourceUrl": "http://dcc249eaaf06:8001/v1.0/tenants/default/buckets/example-data-bucket/objects/5.pdf",
    "ContentLength": 31811,
    "MD5Hash": "DC477A85FF3882BBFDEB03D7B79ECC9E",
    "SHA1Hash": "CC5D85073F193A578F97D46B8A6E4CE946270B5F",
    "SHA256Hash": "E5285C6023A46E4E8917C67CCB56B91FED2E578A7AA3129680012C029868B321",
    "CreatedUtc": "2024-10-25T14:14:22.000000Z"
}

Properties:

  • GUID string globally unique identifier for the object
  • TenantGUID string globally unique identifier for the tenant
  • BucketGUID string globally unique identifier for the bucket where the object is stored
  • DataRepositoryGUID string globally unique identifier for the data repository where the object is stored
  • CollectionGUID string globally unique identifier for the collection
  • ObjectGUID string globally unique identifier for the object
  • ObjectKey string key for the object
  • ObjectVersion string version of the object
  • ContentType string content-type of the object
  • DocumentType enum document type of the object
  • SourceUrl string source URL from which the source object can be retrieved
  • ContentLength long content length of the source document
  • MD5Hash string the MD5 hash, as a hexadecimal string
  • SHA1Hash string the SHA1 hash, as a hexadecimal string
  • SHA256Hash string the SHA256 hash, as a hexadecimal string
  • CreatedUtc datetime timestamp from creation, in UTC time

Create

To upload a source document, call PUT /v1.0/tenants/[tenant-guid]/collections/[collection-guid]/documents with a fully-populated source document. Attach the UDR document as a JSON object within the UdrDocument parameter at the top-level of the object.

Read

To read a source document, call GET /v1.0/tenants/[tenant-guid]/collections. This API will return a JSON array.

To read a collection by GUID, call GET /v1.0/tenants/[tenant-guid]/collections/[collection-guid]. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound error response.

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

{
    "Success": true,
    "Timestamp": {
        "Start": "2024-10-27T06:01:17.502560Z",
        "TotalMs": 91.21,
        "Messages": {
            ... log messages ...
        }
    },
    "MaxResults": 1000,
    "IterationsRequired": 1,
    "ContinuationToken": "3135b2ba-7939-4cc3-8849-bff23b27bc9a",
    "EndOfResults": false,
    "RecordsRemaining": 46,
    "Objects": [
        {
            "GUID": "1fdbe0c8-8b85-4b0e-ac42-dd4757684a9f",
            "TenantGUID": "default",
            "BucketGUID": "example-data-bucket",
            "CollectionGUID": "default",
            "ObjectGUID": "f615ac92-d1d1-4b46-8cc5-acf721131067",
            "ObjectKey": "5.pdf",
            "ObjectVersion": "1",
            "ContentType": "application/pdf",
            "DocumentType": "Pdf",
            "SourceUrl": "http://dcc249eaaf06:8001/v1.0/tenants/default/buckets/example-data-bucket/objects/5.pdf",
            "ContentLength": 31811,
            "MD5Hash": "DC477A85FF3882BBFDEB03D7B79ECC9E",
            "SHA1Hash": "CC5D85073F193A578F97D46B8A6E4CE946270B5F",
            "SHA256Hash": "E5285C6023A46E4E8917C67CCB56B91FED2E578A7AA3129680012C029868B321",
            "CreatedUtc": "2024-10-25T14:14:22.000000Z"
        },
        { ... }
    ]
}

Delete

To delete a source document by GUID, call DELETE /v1.0/tenants/[tenant-guid]/collections/[collection-guid]/documents/[document-guid].