Tutorials & Tricks

I first considered creating a blog when I was challenged with using the authentication process for the Fitbit API. Like many things in life, it’s not hard once you know how, but the process is not obvious. I created the tutorial below to hopefully alleviate someone else’s suffering 🙂 Since then, I’ve added other unusual or interesting tricks I’ve discovered. I will endeavor to add more each week. Don’t hesitate to contact me if you have any questions!

Processing JSON to get the data you want

Wether we went and fetched the data from the API or if the data was sent to our WordPress server automatically you now have some data stored in a variable, in the example a variable called $scaleData. In our study the data from the server was in JSON format and it ... Read more

How to store JSON data to usermeta table

In an earlier step we took the JSON data from the API, decoded it to an array and simplified the data then encoded it back to JSON. This is the JSON: { "July 08, 2024": 69600, "June 23, 2024": 70600, "June 20, 2024": 68500} Storing this in the usermeta table for ... Read more

Automatically receiving data from an API 

An API (Application Program Interface) allows remote computers to communicate with each other. Most importantly, it allows them to share data. The ability to work with a remote API is built right into WordPress! In our Gestational Diabetes study at the McGill University Health Centre, participants were given networked digital scales. ... Read more

Fetching JSON data from API

Some devices, such as the such as the BodyTrace scale, can send data from the API to a server based on any number of triggers. However occasionally there are times when we need to go to the API and pull the data from the API. In order to do this on ... Read more

Tutorial: Accessing the Fitbit API

WordPress is my choice as a backend for fetching and processing user data from Fitbit. There are three main topics to cover: authentication to access the API, integration on our server, and data processing. This tutorial covers the first step: accessing the Fitbit API using the Fitbit Developer site. What you ... Read more