Update Pet
1 min
POST
/api/v1/pets/{id}
Header Parameters
- X-HTTP-METHOD-OVERRIDEstringrequiredDescriptionDefaultPATCH
Form Parameters
- nicknamestringExampleDescription
- birthdaystringExampleDescription
- avatarfileExampleDescription
- species_idintegerExampleDescription
- breed_idintegerExampleDescription
- crossbreedbooleanDescription
- crossbreed_detailsstringDescription
- colorstringExampleDescription
- color_maskinteger[]Description
- distinctive_marksstringExampleDescription
- genderstring<male | female | unknown>Description
- observationsstringDescription
- chip_numberstringExampleDescription
- microchip_locationstringExampleDescription
- insurance_numberstringExampleDescription
- passportstringExampleDescription
- descriptionstringDescription
- constitutionstringDescription
- conformationstringDescription
- allergiesstringDescription
- blood_type_idintegerDescription
- hormonal_statusinteger]Description
Responses
200
- object
- dataPet
- idintegerExample
- nicknamestringExample
- species_idstringExample
- breed_idstringExample
- observationsstring
- genderstring<male | female | unknown>Example
- microchipstring
- crossbreedstring<0 | 1>Example
- crossbreed_details_idinteger
- colorstringExample
- distinctive_marksstring
- birthdaystring<date>Example
- gender_stringstring
- chip_numberstring
- microchip_locationstring
- insurance_numberstring
- passportstring
- profile_picturestringExample
- descriptionstringExample
- constitutionstring
- conformationstring
- weightnumber
- allergiesstring
- nr_recsinteger
- blood_typestring
- hormonal_statusintegerDescription
- agestringExample
- patientNumberstringExample
- is_verifiedstring<0 | 1>Example
- breederstring
- archiveArchiveDescription
- idintegerExample
- reasonstringExample
- typestring<Deceased | Moved away | Change of owner | Other>Example
- birthday_estimatedboolean
- rabic_tag_numberstringExample
- updated_atstring<date-time>Example
curl
curl --request POST \
--url /api/v1/pets/{id} \
--header 'accept: application/json' \
--header 'x-http-method-override: PATCH'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "multipart/form-data");
myHeaders.append("x-http-method-override", "PATCH");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("/api/v1/pets/{id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "net/http"
url = URI("/api/v1/pets/{id}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "multipart/form-data"
request["x-http-method-override"] = "PATCH"
response = http.request(request)
puts response.read_body
python
import requests
url = "/api/v1/pets/{id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'multipart/form-data',
'x-http-method-override': 'PATCH'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// successful operation
{
"data": {
"id": 1,
"nickname": "Fritz",
"species_id": "1",
"breed_id": "1",
"observations": "",
"gender": "male",
"microchip": "",
"crossbreed": "0",
"crossbreed_details_id": 0,
"color": "NavajoWhite",
"distinctive_marks": "",
"birthday": "1983-03-29",
"gender_string": "",
"chip_number": "",
"microchip_location": "",
"insurance_number": "",
"passport": "",
"profile_picture": "https://dev-1-public-digitail.s3.eu-central-1.amazonaws.com/ionut/uploads/KXy8Rlv2vluiZYqwRCy2",
"description": "Lorem ipsum",
"constitution": "",
"conformation": "",
"weight": 0,
"allergies": "",
"nr_recs": 0,
"blood_type": "",
"hormonal_status": 0,
"age": "38 Years, 3 Months, 19 Days",
"patientNumber": "mxc-1 #jwq-1",
"is_verified": "1",
"breeder": "",
"archive": {
"id": 1,
"reason": "The patient was archived because...",
"type": "Deceased"
},
"birthday_estimated": false,
"rabic_tag_number": "12109384",
"updated_at": "2020-06-12 15:45:43"
}
}