Get Document Information

Get Document Information

  1. Get the document metadata GET /v1/documents.
  2. Get the document folder details if needed using the document.documentFolderId property GET /v1/document-folders/{documentFolderId}.
  3. Get the base64 content of the document using the document.id property if needed GET /v1/documents/{id}/content.
  4. Get items associated with the document (customers, loans, etc.) if needed GET /v1/document-associations?documentId={id}.
  5. Get additional data related to the associated items using the respective endpoints (customers, loans, collateral, etc.).

Get document metadata

Use GET /v1/documents to pull all documentation

curl -X GET "https://api.sageworks.com/v1/documents" -H "accept: application/json" -H "authorization: Bearer [Token]"
{
  "items": [
    {
      "id": 17360345,
      "customerId": 85477283,
      "documentFolderId": 69526,
      "uniqueIdentifier": null,
      "name": "PlaidAssetAccountImport.pdf",
      "customerFacingName": null,
      "fileName": "PlaidAssetAccountImport.pdf",
      "sizeInBytes": 20544,
      "isImage": false,
      "isDeleted": false,
      "documentDated": null,
      "description": null,
      "dateUploaded": "2021-10-22"
    },
    {
      "id": 17393560,
      "customerId": 85358242,
      "documentFolderId": 69526,
      "uniqueIdentifier": null,
      "name": "Financial Statement",
      "customerFacingName": null,
      "fileName": "Drake 1040 2019 (2).pdf",
      "sizeInBytes": 15328,
      "isImage": false,
      "isDeleted": false,
      "documentDated": null,
      "description": "Financial Statement",
      "dateUploaded": "2021-10-26"
    }
    }

Get document folder details

Get the document folder details if needed using the document.documentFolderId property GET /v1/document-folders/{documentFolderId}

curl -X GET "https://api.sageworks.com/v1/document-folders/[documentFolderId]" -H "accept: application/json" -H "authorization: Bearer [Token]"
{
  "id": 69526,
  "type": "customer",
  "name": "Loan Documents",
  "parentDocumentFolderId": null,
  "isDeleted": false
}

Get base64 content of the document

Get the base64 content of the document using the document.id property if needed GET v1/documents/{id}/content

curl -X GET "https://api.sageworks.com/v1/documents/[id]/content" -H "accept: application/json" -H "authorization: Bearer [token]"
{
  "content": "[base64]"
}

Get associated items

Get items associated with the document (customers, loans, etc.) if needed GET /v1/document-associations?documentId={id}

curl -X GET "https://api.sageworks.com/v1/document-associations?documentId=[documentId]" -H "accept: application/json" -H "authorization: Bearer [token]"
[
  {
    "id": 123,
    "documentId": 456,
    "objectType": "PortfolioLoan",
    "objectId": 789
  },
  {
    "id": 124,
    "documentId": 456,
    "objectType": "ProposedLoan",
    "objectId": 97423
  },
  {
    "id": 125,
    "documentId": 9965,
    "objectType": "Collateral",
    "objectId": 12345
  },
  {
    "id": 126,
    "documentId": 3222,
    "objectType": "Workflow",
    "objectId": 4325
  }
]

Get associated items' data

At this point other data may be collected from those associated items. Some example endpoints are /v1/customers, /v1/portfolio-loans, /v1/collaterals, etc.)