POST api/Village/{village}/Document
Upload a document. This method MUST be called
with multipart/form-data encoding for the file.
The request payload for the image MUST have Content-Disposition and Content-Type headers. The 'name' in the Content-Disposition header MUST be "file":
- Content-Disposition: form-data; name="file"; filename="whatever-you-want"
- Content-Type: mime/type
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
village | string |
None. |
Body Parameters
ApiDocumentUploadModelName | Description | Type | Additional information |
---|---|---|---|
file |
The file to be uploaded |
ApiFileUpload |
None. |
Id |
When editing an existing document, the ID of that document |
globally unique identifier |
None. |
CategoryId |
Document's Category ID [Obsolete("Replaced with Folders; retained for backwards compatibility")] |
globally unique identifier |
None. |
DisplayName |
Document's Display Name / Title |
string |
String length: inclusive between 0 and 255 |
FolderId |
ID of the folder to which the document belongs |
globally unique identifier |
None. |
Request Formats
application/json, text/json
{ "file": null, "Id": "ffe999aa-05e1-4c72-bc30-85fad456b1d2", "CategoryId": "6d3b6a94-1d32-4bd2-b4f9-6c2f3dd16d30", "DisplayName": "sample string 1", "FolderId": "726a1ee5-de2c-4874-a707-c00748cf3e46" }
application/xml
text/xml
multipart/form-data
Response Information
Resource Description
Document model for the newly uploaded document
VillageDocumentModelName | Description | Type | Additional information |
---|---|---|---|
Id |
Unique ID of the document |
globally unique identifier |
None. |
CategoryId |
ID of the document Category [Obsolete("Replaced with Folders; retained for backwards compatibility")] |
globally unique identifier |
None. |
CategorySequence |
Display sequence for the category [Obsolete("Replaced with Folders; retained for backwards compatibility")] |
integer |
None. |
CategoryName |
Name of the Category [Obsolete("Replaced with Folders; retained for backwards compatibility")] |
string |
None. |
ContentType |
Document's MIME Content Type |
string |
None. |
FileName |
Document's original filename |
string |
None. |
SortName |
The file name for sorting purposes - uses DisplayName if available else FileName |
string |
None. |
FileType |
File Type description |
string |
None. |
Icon |
CSS class(es) to use for icon |
string |
None. |
Uploaded |
Date/Time the file was most recently uploaded/updated |
date |
None. |
UploadedBy |
Name of the user who most recently uploaded/updated the file |
string |
None. |
UploadedById |
Unique ID of the user who most recently uploaded/updated the file |
globally unique identifier |
None. |
Size |
The file's size, in bytes |
integer |
None. |
DisplayName |
The file's Display Name / Title |
string |
None. |
VillageId |
The ID of the village in which the document was uploaded |
globally unique identifier |
None. |
FolderId |
Folder ID of the folder to which the document belongs |
globally unique identifier |
None. |
Response Formats
application/json, text/json
{ "Id": "76b127f9-7cdb-4f6f-aab8-e46315b72cfb", "CategoryId": "eafa3aae-f67e-4b9c-8133-072f56fa3ce1", "CategorySequence": 1, "CategoryName": "sample string 2", "ContentType": "sample string 3", "FileName": "sample string 4", "SortName": "sample string 5", "FileType": "sample string 6", "Icon": "sample string 7", "Uploaded": "2025-06-03T04:32:45.651+00:00", "UploadedBy": "sample string 9", "UploadedById": "de076f8a-8b1c-4c2f-8764-dcf386eb9067", "Size": 11, "DisplayName": "sample string 12", "VillageId": "5888f38f-0c25-4180-8622-ce57158ebba3", "FolderId": "813d0e1c-ecd1-4c75-9a48-70d4039a8f9c" }
application/xml, text/xml
<VillageDocumentModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.Shared.Implementation.Models"> <CategoryId>eafa3aae-f67e-4b9c-8133-072f56fa3ce1</CategoryId> <CategoryName>sample string 2</CategoryName> <CategorySequence>1</CategorySequence> <ContentType>sample string 3</ContentType> <DisplayName>sample string 12</DisplayName> <FileName>sample string 4</FileName> <FileType>sample string 6</FileType> <FolderId>813d0e1c-ecd1-4c75-9a48-70d4039a8f9c</FolderId> <Icon>sample string 7</Icon> <Id>76b127f9-7cdb-4f6f-aab8-e46315b72cfb</Id> <Size>11</Size> <SortName>sample string 5</SortName> <Uploaded>2025-06-03T04:32:45.6516751+00:00</Uploaded> <UploadedBy>sample string 9</UploadedBy> <UploadedById>de076f8a-8b1c-4c2f-8764-dcf386eb9067</UploadedById> <VillageId>5888f38f-0c25-4180-8622-ce57158ebba3</VillageId> </VillageDocumentModel>