Querying for document information

Querying for document metadata

Use the following endpoints to retrieve document metadata.

Endpoint Returns
GET /common/v1/documents/{documentId} Metadata for the given document
GET /claim/v1/claims/{claimId}/documents

Metadata for documents on the given claim

This is a "potentially large" endpoint. Cloud API returns an error if you attempt to sort on this endpoint and the sort cannot be accomplished efficiently. For more information, see Potentially large endpoints.

GET /claim/v1/claims/{claimId}/documents/{documentId} Metadata for the given document

ContactManager also has its own /contact/v1/contacts/{contactId}/documents endpoint.

The following is a portion of an example response from the Common API's /documents/{documentId} endpoint.

Command
GET /common/v1/documents/xc:101

Response

{
    "data": {
        "attributes": {
            "author": "Sue Smith",
            "dateModified": "2020-12-07T23:40:23.534Z",
            "docUID": "2020/11/7/235-53-425892/Legal Ownership of Property",
            "id": "xc:101",
            "inbound": false,
            "mimeType": "text/plain",
            "name": "Legal Ownership of Property",
            "obsolete": false,
            "section": {
                "code": "legal",
                "name": "Legal"
            },
            "status": {
                "code": "final",
                "name": "Final"
            },
            "type": {
                "code": "other",
                "name": "Other"
            }
        },
	  ...

Querying for document content

You can use the following to GET document contents. However, these contents are base64 encoded and therefore are not human-readable until they are decoded.

  • GET /common/v1/documents/{documentId}/content
  • GET /claim/v1/claims/{claimId}/documents/{documentId}/content

The following is a portion of an example response from the Common API's /documents/{documentId}/content endpoint.

Command
GET /common/v1/documents/xc:101/content

Response

RESPONSE:
{
    "data": {
        "attributes": {
            "contents": "REVWIEJVSUxEDQoNCklmIHRoZXJlIGlzIG9ubHkgYSB2aXN1YWxp
emVkIHByb2R1Y3QNCiAgQU5EIHRoZSAiRW5hYmxlZCBmb3IgUmVzdCBBUEkiIGZpZWxkIGlzIGlua
XRpYWxseSBzZXQgdG8gRW5hYmxlZA0KICBBTkQgeW91IGNoYW5nZSB0aGUgZmllbGQgdG8gRGlzYW
JsZWQNCiAgVEhFTiB0aGUgcHJvZHVjdCBpcyBpbW1lZGlhdGVseSB1bmF2YWlsYWJsZSB0byB0aGU
gc3lzdGVtIEFQSXMNCg0KSWYgdG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