Withings API lets you tap into health and wellness data from Withings devices like smart scales, watches, and sleep trackers. The API enables you to fetch measurements such as weight, activity, sleep, and heart rate data. This data can inform personal health apps, trigger notifications for health milestones, or integrate with health coaching platforms. By leveraging Pipedream's power, you can automate workflows that react to this data, enriching user profiles, informing coaching decisions, or driving wellness-focused communities and challenges.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
withings: {
type: "app",
app: "withings",
}
},
async run({steps, $}) {
return await axios($, {
method: "post",
url: `https://wbsapi.withings.net/measure`,
headers: {
Authorization: `Bearer ${this.withings.$auth.oauth_access_token}`,
},
params: {
action: `getmeas`,
},
})
},
})
Health Dashboard Integration: Sync Withings health metrics to a custom dashboard on a regular basis. Use the API to pull the latest user data and display it through widgets or graphs. This can help users track progress over time and provide insights into their health trends.
Fitness Challenge Automation: Create a fitness challenge app where participants' progress is updated based on Withings activity data. Use Pipedream to watch for new Withings activity data and automatically update a leaderboard hosted on Google Sheets or a web app.
Wellness Notification Service: Set up a service that sends out personalized messages or emails when a user reaches certain health milestones. With Pipedream, you can listen for specific changes in Withings data, like weight loss or increased daily step count, and trigger congratulatory notifications via Twilio for SMS or SendGrid for email.
Withings uses OAuth authentication. When you connect your Withings account, Pipedream will open a popup window where you can sign into Withings and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Withings API.
Pipedream requests the following authorization scopes when you connect your account:
user.metrics
user.activity
GET
https://account.withings.com/oauth2_user/authorize2
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.comma_separated_scopes}}
POST
https://wbsapi.withings.net/v2/oauth2
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
action=requesttoken
POST
https://wbsapi.withings.net/v2/oauth2
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{custom_fields.refresh_token}}
&
action=requesttoken