Pet List
user pk 값에 해당하는 펫의 리스트 목록을 반환합니다.
URL
/profile/<user_pk>/pets/
Method
GET
Header
Headers Key | Headers Value | 설명 | Required |
---|---|---|---|
Authorization | Token 321*************************** | 로그인에서 획득한 Token값 입력 | False (입력하지 않으면 Anonymous user로 간주) |
Success Response
HTTP Status code
200
Content
# 형태 설명
{
"count": 4, # 전체 펫의 갯수를 보여줍니다
"next": null, # 페이지네이션. 개체 수가 10개가 넘어가면 다음 페이지 URL이 자동 생성됩니다
"previous": null,
"results": [
{
"owner": {
"pk": 1,
"user_type": "django",
"email": "[email protected]",
"nickname": "husky",
"is_active": true,
"date_joined": "2017-12-21T22:48:16.502063+09:00",
"image": "/static/placeholder/placeholder_human.png"
},
"pet": {
"pk": 4,
"species": "dog",
"breeds": "Shih Tzu",
"name": "삼동이3",
"birth_date": "2013-04-15",
"gender": "male",
"body_color": "brown",
"identified_number": "",
"is_neutering": true,
"is_active": true,
"image": "http://localhost:8000/static/placeholder/placeholder_pet.png"
},
"ages": { # 펫 나이가 함께 출력됩니다
"pet_age": 4,
"conversed_age": 34
}
},
{
"owner": {
"pk": 1,
"user_type": "django",
"email": "[email protected]",
"nickname": "husky",
"is_active": true,
"date_joined": "2017-12-21T22:48:16.502063+09:00",
"image": "/static/placeholder/placeholder_human.png"
},
"pet": {
"pk": 3,
"species": "dog",
"breeds": "Shih Tzu",
"name": "삼동이3",
"birth_date": "2013-04-15",
"gender": "male",
"body_color": "brown",
"identified_number": "",
"is_neutering": true,
"is_active": true,
"image": "http://localhost:8000/static/placeholder/placeholder_pet.png"
},
"ages": {
"pet_age": 4,
"conversed_age": 34
}
},
{
"owner": {
"pk": 1,
"user_type": "django",
"email": "[email protected]",
"nickname": "husky",
"is_active": true,
"date_joined": "2017-12-21T22:48:16.502063+09:00",
"image": "/static/placeholder/placeholder_human.png"
},
"pet": {
"pk": 2,
"species": "dog",
"breeds": "Shih Tzu",
"name": "삼동이2",
"birth_date": "2013-04-15",
"gender": "male",
"body_color": "brown",
"identified_number": "",
"is_neutering": true,
"is_active": true,
"image": "http://localhost:8000/static/placeholder/placeholder_pet.png"
},
"ages": {
"pet_age": 4,
"conversed_age": 34
}
},
{
"owner": {
"pk": 1,
"user_type": "django",
"email": "[email protected]",
"nickname": "husky",
"is_active": true,
"date_joined": "2017-12-21T22:48:16.502063+09:00",
"image": "/static/placeholder/placeholder_human.png"
},
"pet": {
"pk": 1,
"species": "dog",
"breeds": "Rottweiler",
"name": "빵빵이",
"birth_date": "2016-12-31",
"gender": "female",
"body_color": "gold",
"identified_number": "",
"is_neutering": true,
"is_active": false,
"image": "http://localhost:8000/media/thumbnail/pet/%E1%84%8C%E1%85%AE%E1%84%89%E1%85%A5%E1%86%AB%E1%84%8B%E1%85%A7%E1%86%BC.jpeg"
},
"ages": {
"pet_age": 1,
"conversed_age": 15
}
}
]
}
Error Response
HTTP Status code
404
Content
# 존재하지 않는 pk 값을 입력했을 경우
{
"detail": "Not found."
}