POST api/violationphotos
Insert a violation photo. The file and the form data must be posted using Content-Type:multipart/form-data. We expect the following besides the actual bytes for the image: caption creationdate pic violationID
Request Information
Authentication
This method requires user authentication
URI Parameters
None.
Body Parameters
None.
Response Information
Resource Description
ViolationPhoto| Name | Description | Type | Additional information |
|---|---|---|---|
| ViolationId |
Violation Id. See the GET api/violations/{id} route to get the violation data. |
integer |
None. |
| PhotoId |
Photo Id. Primary key of the child model table. |
integer |
None. |
| Pic |
Photo Name. The actual name of the image file. |
string |
None. |
| Caption |
Photo Caption. |
string |
None. |
| CreationDate |
Photo Creation Date. |
date |
None. |
| PathToFile |
The path to the actual location of the file. |
string |
None. |
Response Formats
application/json, text/json
Sample:
{
"ViolationId": 1,
"PhotoId": 1,
"Pic": "sample string 2",
"Caption": "sample string 3",
"CreationDate": "2025-12-24T05:24:14.753355-05:00",
"PathToFile": "sample string 4"
}
Internal Error Codes
-
106: ResourceNotFound
(The requested resource was not found., NotFound) -
100: MissingRequiredHeader
(Invalid request format. A required HTTP header was not specified., BadRequest) -
118: InvalidHeaderValue
(The value provided for one of the HTTP headers was not in the correct format., BadRequest) -
199: UnknownError
(Internal server error., InternalServerError) -
105: ResourceNotLinkedToUser
(User is trying to access a resource that belongs to a property not linked to the user., Forbidden) -
112: InvalidOperation
(The operation is not valid., Conflict) -
113: WriteOperationFailed
(The requested operation failed., Conflict) -
109: MissingRequiredJsonParameter
(Invalid request format. A required parameter in the request body was not specified for this request., BadRequest) -
114: InvalidJsonParameterValue
(Invalid request format. The value provided for one of the parameters in the request body was not in the correct format., BadRequest)