A Fitbit Low Battery SMS Notification using AWS – Part 2

In Part 1, I introduced an app that sends an SMS notification when your Fitbit battery is low. Part 2 covers the Authentication Flow of the process.

Fitbit-SMS-Auth

The flow is as follows:

  1. User accesses the sign-up page (and by default, provides authorization via Fitbit.com). The request is passed through an API Gateway to a Lambda function. The Lambda function calls a Fitbit api to authenticate the user.
  2. The Fitbit authentication returns to the Lambda code. From there: (3) the token is saved to a DynamoDB database, (4) a message is placed on a SNS topic, and (5) a success response is sent back to the webpage
  3. The user information (access_token, refresh_token, and mobile number) is saved to a DynamoDB table
  4. An SNe1079abb478cc4e04d13615bc10aa4ca[1]S topic receives the mobile number as a message
  5. A success message is sent back to the end user.
  6. The SNS topic (step 4) calls a second Lambda function.
  7. The Create_User_Topic lambda function creates a sns topic for the newly authenticated user.
  8. Once the topic is created, a notice is sent to the user’s mobile device – asking to confirm subscription.
  9. The user confirms the subscription.

Continue reading “A Fitbit Low Battery SMS Notification using AWS – Part 2”

A Fitbit Low Battery SMS Notification using AWS – Part 1

765a3f73cd8c5b0c0bc96bc3cd094740[1]

A few weeks ago, my Fitbit (one of my new favorite devices) died.

Not died, as in bricked; my battery died.

That was a bit surprising, as I am signed up for low battery notifications. Turns out, I did get a notice – in an email. Problem was, I wasn’t checking my email that day.1

fitbit_notificationThe next day, I went back to the Fitbit website to sign-up for SMS notifications; unfortunately, Fitbit doesn’t provide a low battery notification via SMS.

So, I built my own, using a handful of AWS services (Lambda, SNS, API Gateway, and DynamoDB) and exposed Fitbit APIs.

So far, it works well. After subscribing to the service, I got an introductory note telling my my battery status. A few hours later, I received a second notice – letting me know that my battery was low. Continue reading “A Fitbit Low Battery SMS Notification using AWS – Part 1”