Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rcmdnk/withings-gas-example
Google App Script example for Withings API
https://github.com/rcmdnk/withings-gas-example
Last synced: about 1 month ago
JSON representation
Google App Script example for Withings API
- Host: GitHub
- URL: https://github.com/rcmdnk/withings-gas-example
- Owner: rcmdnk
- License: apache-2.0
- Created: 2020-09-22T09:23:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T08:41:12.000Z (12 months ago)
- Last Synced: 2024-05-01T12:24:48.631Z (7 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Withings-gas-example
Google Apps Script example for Withings API using [gsuitedevs/apps-script-oauth2](https://github.com/gsuitedevs/apps-script-oauth2).## Preparation
* Make new [Google Apps Script project](https://script.google.com/home).
* Make new script named like `Withings` and copy and paste [Withings.gs](https://github.com/rcmdnk/Withings-gas-example/blob/main/Withings.gs) contents.
* Set CLIENT_ID and CLIENT_SECRET
* Make sure you have a [Withings account](https://account.withings.com/connectionuser/account_create).
* Register as [Withings API partner here](https://account.withings.com/partner/add_oauth2).
* callback function should be like: `https://script.google.com/macros/d//usercallback`
* `SCRIPT_ID` is found in the menu: File -> Project properties -> Script Id
* Get client id and client (consumer) secret.## Get weight information
* Run `run` function.
* First time you run, go View->Log. You will see URL for authentication.
* After that, you will see weight information in the log.
## Get other information
* Set `MEASTYPES`: [Withings API | Measure](https://developer.withings.com/oauth2/#tag/measure)
* 1: Weight, 6: Fat Ratio, 88: Bone Mass, etc...## Change period to get information
* Set `DAYS`: default is 30 days.