Inoculation Patch
user pk, pet pk, ino pk 값에 해당하는 펫의 백신 접종 기록을 수정합니다
URL
/medical/<user_pk>/pets/<pet_pk>/inoculations/<ino_pk>/
Method
PATCH
Header
Headers Key | Headers Value | 설명 | Required |
---|---|---|---|
Authorization | Token 321*************************** | 로그인에서 획득한 Token값 입력 | True |
Data Params
Key | Description | Value | Type | Required |
---|---|---|---|---|
vaccine | 동물이 맞은 백신 | False | ||
num_of_times | 여태까지 이 백신을 맞은 횟수 | Positive Integer | False | |
inoculated_date | 접종 날짜와 시각을 분 단위까지 입력 | YYYY-MM-DDThh:mm | datetime | False |
hospital | 접종 받은 병원 | 문자열 | String | False |
is_alarm | 알람을 받을 것인지 | Boolean | Default=False |
(바꾸고 싶은 필드의 payload 키 & 값만 입력하면 됩니다) (입력하지 않은 필드는 수정하지 않는 걸로 간주합니다)
Success Response
HTTP Status code
200
Content
{
"vaccine_info": { # 동물이 맞은 백신에 대한 정보
"species": "dog", # 동물 종류
"name": "종합백신(DHPPL)", # 백신 이름
"turn": 5, # 이 백신을 맞아야 할 총 횟수
"period": "14 00:00:00" # 이 백신을 맞아야 할 주기
},
"inoculation_info": { # 동물의 백신 접종에 관한 정보
"medical": "빵빵이", # 펫의 이름
"pk": 3, # 접종 객체의 pk
"vaccine": "종합백신(DHPPL)", # 펫이 맞은 백신
"num_of_times": 1, # 펫이 이 백신을 맞은 횟수
"inoculated_date": "2017-12-01T17:00:00+09:00", # 펫이 팩신을 맞은 시각
"hospital": "패캠동물병원", # 펫이 백신을 맞은 병원
"is_alarm": false # 알람을 받을 것인가
}
}
Error Response
HTTP Status code400
Content
# 필수 입력 값을 입력하지 않은 경우 / 올바른 숫자를 입력하지 않은 경우
{
"vaccine": [
"This field may not be null."
],
"num_of_times": [
"A valid integer is required."
],
"inoculated_date": [
"Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]."
]
}
HTTP Status code401 Unauthorized
Content
# 토큰을 전달하지 않은 경우(로그인하지 않은 유저의 접근)
{
"detail": "Authentication credentials were not provided."
}
# 잘못된 토큰으로 접근한 경우(만료된 토큰, DB에 존재하지 않는 토큰)
{
"detail": "Invalid token."
}
HTTP Status code403 Forbidden
Content
# 다른 유저의 토큰으로 접근한 경우
{
"detail": "You do not have permission to perform this action."
}
HTTP Status code
404 Not Found
# pk값이 올바르지 않게 입력된 경우
{
"detail": "Not found."
}