The Withings API allows developers to access and leverage Withings health data to create innovative and valuable applications. With the Withings API, users are able to build applications that give them access to data from Withings’ connected health devices such as activity trackers, digital scales, and blood pressure and thermometer devices.
With the Withings API, it is possible to build applications that help users connect to their data and use it effectively and efficiently. Here are a few examples of what can be achieved with the Withings API:
By leveraging the Withings API, developers are able to unlock valuable, actionable data to create innovative and useful applications that can improve users’ lives.
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`,
},
})
},
})
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