Baby Services

Manages Baby profiles, profile images, log Height/Weight massurement and activities(Diaper, Feeding, Formula).

Pre-requisite: The user has to be signed in to perform the following operations.


Overview

The Baby services APIs provide functionality to create and manage Baby profiles, profile images, log Height/Weight massurement and activities(Diaper, Feeding, Formula) workflows.


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: UpdatebabyProfileRequest
    ) -> 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.
  • 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>

Log Baby Growth

To log a baby’s growth record, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyId (required): The ID of the baby.
  • request (required): Contains baby growth information.
Factory.babyService.logBabyGrowth(
        spaceId: String,
        babyId: String,
        request: LogBabyGrowthRequest
    ) -> IVPublisher<BabyGrowthEntry>

List Baby Growth

To fetch all growth records associated with a baby, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyId (required): The ID of the baby.
  • limit (required): Maximum number of records to return.
  • skip (required): Number of records to skip.
Factory.babyService.listBabyGrowth(
        spaceId: String,
        babyId: String,
        limit: Int,
        skip: Int
    ) -> IVPublisher<ListBabyGrowthResponse>

Log Baby Activities

To log one or more baby activities, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyId (required): The ID of the baby.
  • request (required): Contains baby activity information.
Factory.babyService.logActivity(
        spaceId: String,
        babyId: String,
        request: LogMultipleBabyActivityRequest
    ) -> IVPublisher<[BabyActivityLogModel]>

List Baby Activities

To fetch baby activity logs, The following method can be used:

  • spaceId (required): The space ID of the User.
  • babyIds (optional): Filter by one or more baby IDs.
  • type (optional): Filter by activity type(s).
  • from (optional): Start timestamp in milliseconds.
  • to (optional): End timestamp in milliseconds.
  • limit (required): Maximum number of records to return.
  • skip (required): Number of records to skip.
Factory.babyService.listActivities(
        spaceId: String,
        babyIds: [String]?,
        type: [String]?,
        from: Int64?,
        to: Int64?,
        limit: Int,
        skip: Int
    ) -> IVPublisher<ListBabyActivitiesResponse>

Delete Baby Activities

To delete one or more baby activity logs, The following method can be used:

  • spaceId (required): The space ID of the User.
  • request (required): Contains the activity IDs to delete.
Factory.babyService.deleteActivities(
        spaceId: String,
        request: DeleteBabyActivitiesRequest
    ) -> IVPublisher<Void>

Get Deleted Baby Activity Logs

To fetch all deleted baby activity logs, The following method can be used:

  • spaceId (required): The space ID of the User.
Factory.babyService.getDeletedBabyActivityLogs(
        spaceId: String
    ) -> IVPublisher<DeletedBabyActivityLogsModel>

Get Lullaby Settings

To fetch the current lullaby settings for a device, The following method can be used:

  • spaceId (required): The space ID of the User.
  • deviceId (required): The ID of the device.
Factory.babyService.getLullabySettings(
        spaceId: String,
        deviceId: String
    ) -> IVPublisher<LullabySettingsModel>

Update Lullaby Settings

To update the lullaby settings for a device, The following method can be used:

  • spaceId (required): The space ID of the User.
  • deviceId (required): The ID of the device.
  • request (required): Contains updated lullaby settings.
Factory.babyService.updateLullabySettings(
        spaceId: String,
        deviceId: String,
        request: LullabyPlayRequest
    ) -> IVPublisher<LullabySettingsModel>