Offbeat Iot
Get started
Using the Fitbit integration

Using the Fitbit integration

Send the following JSON requests from your device and inspect the documented responses.

Get activities summary

{
  "fitbit.activities" : ""
}
{
  "caloriesOut" : 2628,
  "activityCalories" : 525,
  "endpointId" : "test-endpoint-id",
  "steps" : 1698,
  "veryActiveMinutes" : 0,
  "caloriesBMR" : 1973,
  "sedentaryMinutes" : 802
}

Get body (weight + fat)

{
  "fitbit.get.body" : ""
}
{
  "fat" : 15,
  "weight" : 200,
  "endpointId" : "test-endpoint-id",
  "bmi" : 25.91
}

Get weight

{
  "fitbit.get.weight" : "14-07-2024"
}
{
  "weight" : 200,
  "endpointId" : "test-endpoint-id",
  "bmi" : 25.91
}

Get current weight

{
  "fitbit.get.current.weight" : ""
}
{
  "weight" : 100,
  "endpointId" : "test-endpoint-id",
  "weightUnit" : "METRIC"
}

Get weight goal

{
  "fitbit.get.weight.goal" : ""
}
{
  "weightGoal" : {
    "goalType" : "LOSE",
    "startDate" : "2018-06-13",
    "startWeight" : 105.28,
    "weight" : 99.79,
    "weightThreshold" : 0.05
  },
  "endpointId" : "test-endpoint-id"
}

Create weight log

{
  "fitbit.create.weight" : "100"
}
{
  "endpointId" : "test-endpoint-id",
  "fitbit.create.weight" : {
    "result" : "OK"
  }
}

Create fat log

{
  "fitbit.create.fat" : "21"
}
{
  "fitbit.create.fat" : {
    "result" : "OK"
  },
  "endpointId" : "test-endpoint-id"
}

Create food log

{
  "fitbit.create.food.log" : {
    "amount" : "5",
    "foodId" : 5678,
    "mealTypeId" : 1,
    "unitId" : "ml"
  }
}
{
  "fitbit.create.food.log" : {
    "result" : "OK"
  },
  "endpointId" : "test-endpoint-id"
}

Get food log

{
  "fitbit.food" : ""
}
{
  "fitbit.food.log" : {
    "sodium" : 760,
    "fiber" : 5,
    "carbs" : 46,
    "protein" : 18,
    "fat" : 3.5,
    "calories" : 280,
    "water" : 0
  },
  "endpointId" : "test-endpoint-id"
}

Get food goal

{
  "fitbit.get.food.goal" : ""
}
{
  "fitbit.food.goal" : {
    "calories" : 2910
  },
  "endpointId" : "test-endpoint-id"
}

Get water log

{
  "fitbit.get.water" : ""
}
{
  "fitbit.get.water" : {
    "water" : 0.0
  },
  "endpointId" : "test-endpoint-id"
}

Create water log

{
  "fitbit.create.water.log" : {
    "unit" : "ml",
    "amount" : "124"
  }
}
{
  "fitbit.create.water.log" : {
    "result" : "OK"
  },
  "endpointId" : "test-endpoint-id"
}

Get water goal

{
  "fitbit.get.water.goal" : ""
}
{
  "fitbit.get.water.goal" : {
    "goal" : 24,
    "startDate" : "2019-03-21"
  },
  "endpointId" : "test-endpoint-id"
}

Get sleep log

{
  "fitbit.get.sleep" : ""
}
{
  "fitbit.get.sleep" : {
    "totalMinutesAsleep" : 384,
    "stagesWake" : 78,
    "totalTimeInBed" : 462,
    "stagesDeep" : 104,
    "stageLight" : 205,
    "totalSleepRecords" : 1,
    "stagesRem" : 75
  },
  "endpointId" : "test-endpoint-id"
}

Get sleep goal

{
  "fitbit.get.sleep.goal" : ""
}
{
  "fitbit.get.sleep.goal" : {
    "consistency.flowId" : 2,
    "goal.minDuration" : 480
  },
  "endpointId" : "test-endpoint-id"
}
Integrate