Skip to content

Instantly share code, notes, and snippets.

@loudestnoise
Created August 10, 2020 22:45
Show Gist options
  • Save loudestnoise/8355939da3918ec356ca2e5bf20f6452 to your computer and use it in GitHub Desktop.
Save loudestnoise/8355939da3918ec356ca2e5bf20f6452 to your computer and use it in GitHub Desktop.
Export Tidepool Web data to JSON using API
(user @ host): ~
--> curl -v -X POST -u [email protected] https://api.tidepool.org/auth/login
Enter host password for user '[email protected]':
* Trying 34.216.109.25...
* TCP_NODELAY set
* Connected to api.tidepool.org (34.216.109.25) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=api.tidepool.org
* start date: Jul 9 23:19:59 2020 GMT
* expire date: Oct 7 23:19:59 2020 GMT
* subjectAltName: host "api.tidepool.org" matched cert's "api.tidepool.org"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Server auth using Basic with user '[email protected]'
* Using Stream ID: 1 (easy handle 0x7fa9cc00a800)
> POST /auth/login HTTP/2
> Host: api.tidepool.org
> Authorization: Basic ZGF2aWRAZGF2aWRjaW50cm9uLmNvbTp6WlhQUGlSNEFWKmR4VjZGTkZ3eG9BTlYy
> User-Agent: curl/7.64.1
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 2147483647)!
< HTTP/2 200
< content-type: application/json
< x-tidepool-session-token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhcGkudGlkZXBvb2wub3JnIiwiZHVyIjoyNTkyMDAwLCJleHAiOjE1OTk2OTExMTUsImlhdCI6MTU5NzA5OTExNSwiaXNzIjoiYXBpLnRpZGVwb29sLm9yZyIsInN1YiI6IjM5OGQwYWM3NzEiLCJzdnIiOiJubyIsInVzciI6IjM5OGQwYWM3NzEifQ.dsIg3IOlZABbhTh1-_5DR9LGec5NM6gU8FfQ7f4FD_fMTIYmYKOSUWQr2srtVG2e69zMcBzqlgc8YU_aN5AsYUfzSDKHfESLP9DwFHRc_7581Q2blKSJNek7YnV8uy7FgwCrihqKnOo4w6i36NSF8K2mT4c5ZOxvdKwWCrU9l5BajFNzoibddu-9FQtWJJoDBgee6a6XP2K_NyPtKHvAmNSSJZECHvIpAM8t0-FHT5CluHSxvoLSnHrgZO4q7ITaGAy5-_5bq_4IAcCN5vKcbVS3IRoyRg6ptj3zDbL0i11
< date: Mon, 10 Aug 2020 22:38:35 GMT
< content-length: 160
< x-envoy-upstream-service-time: 12
< server: envoy
<
* Connection #0 to host api.tidepool.org left intact
{"emailVerified":true,"emails":["[email protected]"],"termsAccepted":"2017-05-30T11:15:16-05:00","userid":"398d0ac771","username":"email@domaincom"}* Closing connection 0
(user @ host): ~
--> curl -s -X GET -H "x-tidepool-session-token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhcGkudGlkZXBvb2wub3JnIiwiZHVyIjoyNTkyMDAwLCJleHAiOjE1OTk2OTExMTUsImlhdCI6MTU5NzA5OTExNSwiaXNzIjoiYXBpLnRpZGVwb29sLm9yZyIsInN1YiI6IjM5OGQwYWM3NzEiLCJzdnIiOiJubyIsInVzciI6IjM5OGQwYWM3NzEifQ.dsIg3IOlZABbhTh1-_5DR9LGec5NM6gU8FfQ7f4FD_fMTIYmYKOSUWQr2srtVG2e69zMcBzqlgc8YU_aN5AsYUfzSDKHfESLP9DwFHRc_7581Q2blKSJNek7YnV8uy7FgwCrihqKnOo4w6i36NSF8K2mT4c5ZOxvdKwWCrU9l5BajFNzoibddu-9FQtWJJoDBgee6a6XP2K_NyPtKHvAmNSSJZECHvIpAM8t0-FHT5CluHSxvoLSnHrgZO4q7ITaGAy5-_5bq_4IAcCN5vKcbVS3IRoyRg6ptj3zDbL0i11" -H "Content-Type: application/json" "https://api.tidepool.org/data/398d0ac771" > ~/Downloads/data_download.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment