Fetching Documents Details

Fetching Details Of Document Using Document Id

The API provides the ability to fetch details of document using document Id

GET /api/documents/{documentId}

Where:

  • documentId: The Id of document for which details would be fetched

Upon successful execution, an HTTP 200 OK status code is returned with a response body like the following:

{
    "DocumentId": 39,
    "DocumentName": "TestFile.mp4",
    "DocumentSize": 2000000000,
    "FolderId": 3,
    "DateModified": "2022-03-23T05:47:45.9342697Z",
    "Hash": "3FkICYXkxi4pURPU2WwAma3Lmlg=",
    "Links": {
        "Self": "https://app.sharebase.com/sharebaseapi/api/documents/39",
        "Content": "https://app.sharebase.com/sharebaseapi/api/documents/39/content",
        "Revisions": "https://app.sharebase.com/sharebaseapi/api/documents/39/revisions"
    }
}

Where:

  • DocumentId: the unique identifier of the document
  • DocumentName: the name of the document
  • DocumentSize: the size of the document in bytes
  • FolderId: the folder Identifier on which the document resides
  • DateModified: the date/time on which the document was last modified
  • Hash: the encryption hash of the document
  • Links: some usefull links related to the document
    • Self: a hyperlink to the current document
    • Content: a hyperlink to download the content of current document
    • Revisions: a hyperlink to the revisions of the current doucument

Fetching Detail Of Documents Inside A Folder Using Folder Id

The API provides the ability to fetch details of the documents inside a folder using the folder id

GET /api/folders/{folderId}/documents

Where:

  • folderId: the Id of the folder, for which the details of the document would be fetched

Upon successful execution, an HTTP 200 OK status code is returned with a response body like the following:

[
    {
        "DocumentId": 39,
        "DocumentName": "2GB.bin",
        "DocumentSize": 2000000000,
        "FolderId": 3,
        "DateModified": "2022-03-23T05:47:45.9342697Z",
        "Hash": "3FkICYXkxi4pURPU2WwAma3Lmlg=",
        "Links": {
            "Self": "https://app.sharebase.com/sharebaseapi/api/documents/39",
            "Content": "https://app.sharebase.com/sharebaseapi/api/documents/39/content",
            "Revisions": "https://app.sharebase.com/sharebaseapi/api/documents/39/revisions"
        }
    },
    {
        "DocumentId": 40,
        "DocumentName": "1GB-2 (1).bin",
        "DocumentSize": 1048576000,
        "FolderId": 3,
        "DateModified": "2022-03-23T05:49:50.7739656Z",
        "Hash": "yxn4NsKDD/iP9FaUVl2mW+c7emk=",
        "Links": {
            "Self": "https://app.sharebase.com/sharebaseapi/api/documents/40",
            "Content": "https://app.sharebase.com/sharebaseapi/api/documents/40/content",
            "Revisions": "https://app.sharebase.com/sharebaseapi/api/documents/40/revisions"
        }
    }
]

Where:

The result contains a array of detail of documents

  • DocumentId: the unique identifier of the document
  • DocumentName: the name of the document
  • DocumentSize: the size of the document in bytes
  • FolderId: the folder Identifier on which the document resides
  • DateModified: the date/time on which the document was last modified
  • Hash: the encryption hash of the document
  • Links: some usefull links related to the document
    • Self: a hyperlink to the current document
    • Content: a hyperlink to download the content of current document
    • Revisions: a hyperlink to the revisions of the current doucument

Note: The result set contains on the immediate documents inside a folder. However, It does not contain any documents which may be present inside a child folder