getPetDetail(data: GetPetDetail)

Requires:
@ray-js/ray≥1.6.27

Description

Get pet details

Parameters

ParameterTypeRequiredDescription
YesRequest parameters: ownerId (home ID), id (pet ID)

Return Value

Type: Promise<PetDetail>
Promise; resolves to pet details (PetDetail)

Referenced Types

typePetDetail
PropertyTypeDescription
ownerIdstringHome ID
petType"cat" | "dog"Pet type
namestringPet name; must not exceed 40 characters
avatarstringPet avatar path; starts with "smart/"
sexnumberSex: 0 - female, 1 - male, 2 - spayed female, 3 - neutered male
activenessnumberActivity level: 0 - inactive, 1 - normal, 2 - very active
birthnumberBirthday, unit: milliseconds
weightnumberWeight, unit: g
breedCodestringBreed code (obtain from the pet breed list API)
rfidstringrfid
idnumberPet ID
avatarDisplaystringAccessible path for pet avatar
breedNamestringBreed name
extInfostringAdditional information; do not include sensitive information
personalitiesstring[]Pet personality code
Front-facing photo of the pet
Pet feature code
devIdsstring[]Associated device IDs
Associated main food information
weightType0 | 1 | 2Body condition: 0 - underweight, 1 - normal, 2 - overweight (requires associated main food, breed, etc.)
dailyCalorienumberDaily recommended calories, unit: Kcal (requires associated main food, breed, etc.)
dailyFeedingnumberDaily recommended feeding amount, unit: g (requires associated main food, breed, etc.)
gmtCreatenumberCreation timestamp, in milliseconds
gmtModifiednumberUpdate timestamp, in milliseconds

Valid Values

PetDetail.petType
ValueDescriptionSince
cat--
dog--
PetDetail.weightType
ValueDescriptionSince
0--
1--
2--

Examples

Request example

import { getPetDetail } from '@ray-js/ray';

getPetDetail({
  ownerId: 'xxxx',
  id: 1,
});

Response example

{
  "id": 1,
  "ownerId": "xxxx",
  "petType": "cat",
  "name": "Fubao",
  "avatar": "smart/xxxx/xxxx/xxxx",
  "avatarDisplay": "https://xxx/xxx",
  "sex": 1,
  "activeness": 1,
  "birth": 1614528000000,
  "weight": 5000,
  "breedCode": "xxx",
  "breedName": "Chinchilla",
  "rfid": "xxxxx",
  "extInfo": "",
  "idPhotos": [
    {
      "angle": "firstFront",
      "display": "https://xxx/xxx",
      "objectKey": "xxxx"
    }
  ],
  "features": [
    {
      "category": "eyeColor",
      "details": ["brown"]
    }
  ],
  "personalities": ["independent"],
  "relationFood": {
    "id": 22,
    "name": "xxx"
  },
  "weightType": 1,
  "dailyCalorie": 62.7,
  "dailyFeeding": 191,
  "gmtCreate": 1740792022716,
  "gmtModified": 1741785184589
}