Baby Profiles
A baby profile belongs to a space. It carries the baby’s details and a profile image, and is what growth records and care logs hang off. Lullaby settings are stored per camera, not per baby.
All calls are on Factory.babyService.
Pre-requisite: The user has to be signed in to perform the following operations.
Create Baby Profile
To create a new baby profile within a space, The following method can be used:
spaceId(required): The space ID of the User.request(required): Contains baby profile information.
Factory.babyService.createBabyProfile(
spaceId: String,
request: BabyProfileRequest
) -> IVPublisher<BabyProfile>
List Baby Profiles
To fetch all baby profiles associated with a space, The following method can be used:
spaceId(required): The space ID of the User.
Factory.babyService.listBabyProfiles(
spaceId: String
) -> IVPublisher<ListBabyProfilesResponse>
Get Baby Profile
To fetch detailed information of a specific baby profile, The following method can be used:
spaceId(required): The space ID of the User.babyId(required): The ID of the baby.
Factory.babyService.getBabyProfile(
spaceId: String,
babyId: String
) -> IVPublisher<BabyProfile>
Update Baby Profile
To update an existing baby profile, The following method can be used:
spaceId(required): The space ID of the user.babyId(required): The ID of the baby.request(required): Updated baby profile details.
Factory.babyService.updateBabyProfile(
spaceId: String,
babyId: String,
request: BabyProfileRequest
) -> IVPublisher<BabyProfile>
Delete Baby Profile
To delete a baby profile, The following method can be used:
spaceId(required): The space ID of the user.babyIds(required): The list of ID of the baby you want to delete.
Factory.babyService.deleteBabyProfiles(
spaceId: String,
babyIds: [String]
) -> IVPublisher<Void>
Get Baby Image Upload URL
To fetch upload URL for baby image uploads, The following method can be used:
spaceId(required): The space ID of the user.babyId(required): The ID of the baby.
Factory.babyService.getBabyImageUploadURL(
spaceId: String,
babyId: String
) -> IVPublisher<BabyImageUploadURLResponse>
Upload Baby Image
To upload baby images, The following method can be used:
spaceId(required): The space ID of the user.name(required): Name of the image file (.jpgis appended; the data must be JPEG). Use the same value asBabyProfileRequest.profileImageNameto attach it to the profile.data(required): Binary image data.url(required): Upload URL.authToken(required): Authorization token for upload.
Factory.babyService.uploadImage(
spaceId: String,
name: String,
data: Data,
url: String,
authToken: String
) -> IVPublisher<Void>