PUT api/Village/{village}/Medication/{id}/Photos

Update medication photos. This method MUST be called with multipart/form-data encoding for the file

The request payload for the image MAY include a pill photo, which MUST have Content-Disposition and Content-Type headers. The 'name' in the Content-Disposition header MUST be "pillphoto":

  • Content-Disposition: form-data; name="pillphoto"; filename="whatever-you-want"
  • Content-Type: mime/type
The request payload for the image MAY include a label photo, which MUST have Content-Disposition and Content-Type headers. The 'name' in the Content-Disposition header MUST be "labelphoto":
  • Content-Disposition: form-data; name="labelphoto"; filename="whatever-you-want"
  • Content-Type: mime/type

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

globally unique identifier

Required

village

string

None.

Body Parameters

ApiMedicationPhotoModel
NameDescriptionTypeAdditional information
pillphoto

The pill photo

ApiFileUpload

None.

labelphoto

The label photo

ApiFileUpload

None.

RemovePillPhoto

If true and pillPhoto is null, remove the existing pill photo

boolean

None.

RemoveLabelPhoto

If true and labelPhoto is null, remove the existing label photo

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "pillphoto": null,
  "labelphoto": null,
  "RemovePillPhoto": true,
  "RemoveLabelPhoto": true
}

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 'ApiMedicationPhotoModel'.

Response Information

Resource Description

true if the medication was updated successfully

PrimitiveOfBoolean
NameDescriptionTypeAdditional information
value

boolean

Required

Response Formats

application/json, text/json

Sample:
{
  "value": true
}

application/xml, text/xml

Sample:
<PrimitiveOfboolean xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.API.Models">
  <value>true</value>
</PrimitiveOfboolean>