PUT api/Village/{village}/Document/{id}

Update a document. If the existing file is being replaced, this method MUST be called with multipart/form-data encoding for the file

If the existing file is being replaced, 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

NameDescriptionTypeAdditional information
village

string

None.

id

string

None.

Body Parameters

ApiDocumentUploadModel
NameDescriptionTypeAdditional 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

Sample:
{
  "file": null,
  "Id": "0a5cd7d6-a790-41bd-b8b2-1943a1821e57",
  "CategoryId": "3e6dadf7-4216-4057-9e63-a27fa5614091",
  "DisplayName": "sample string 1",
  "FolderId": "e6c484a7-0c76-4988-bad6-c7ab75f3d473"
}

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Type 'CaringVillage.API.Models.ApiFileUpload' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Type 'CaringVillage.API.Models.ApiFileUpload' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.

multipart/form-data

Sample:

Failed to generate the sample for media type 'multipart/form-data'. Cannot use formatter 'MultipartMediaTypeFormatter' to write type 'ApiDocumentUploadModel'.

Response Information

Resource Description

Document model for the updated document

VillageDocumentModel
NameDescriptionTypeAdditional 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

Sample:
{
  "Id": "e35074b4-928c-4585-931f-503422429b4f",
  "CategoryId": "c12200b9-95ca-499d-a4f9-35b46156fed3",
  "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:59:37.652+00:00",
  "UploadedBy": "sample string 9",
  "UploadedById": "6169491d-5515-45b9-aac5-db894b3c77cd",
  "Size": 11,
  "DisplayName": "sample string 12",
  "VillageId": "1d54588d-ee85-4e4f-8c3a-3f275a04bfea",
  "FolderId": "62c9d9a0-dc30-4c7f-b9ef-48c1f51887e8"
}

application/xml, text/xml

Sample:
<VillageDocumentModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.Shared.Implementation.Models">
  <CategoryId>c12200b9-95ca-499d-a4f9-35b46156fed3</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>62c9d9a0-dc30-4c7f-b9ef-48c1f51887e8</FolderId>
  <Icon>sample string 7</Icon>
  <Id>e35074b4-928c-4585-931f-503422429b4f</Id>
  <Size>11</Size>
  <SortName>sample string 5</SortName>
  <Uploaded>2025-06-03T04:59:37.6527836+00:00</Uploaded>
  <UploadedBy>sample string 9</UploadedBy>
  <UploadedById>6169491d-5515-45b9-aac5-db894b3c77cd</UploadedById>
  <VillageId>1d54588d-ee85-4e4f-8c3a-3f275a04bfea</VillageId>
</VillageDocumentModel>