This article assumes:
- You have a Tidepool Web account - Signing up for Tidepool
- Made some notes on your Tidepool Web account
Downloading all of your Note data from the command-line
1a. On a Mac
Open Terminal via Spotlight (Command + Space and searching for Terminal) or by opening it via Finder:
- Click on Finder on your Dock.
- Click on Go (1) and then select Utilities (2).
- From the window that appears, double-click on Terminal.
1b. On a PC
Open Command Prompt:
- Selectand begin typing Command and click on Command Prompt from the search results that appear.
2. Running the queries on Terminal or Command-Line
After you open Terminal or Command Prompt, copy and paste the following, replacing <youremail@email.com> without the < >.
curl -v -X POST -u <youremail@email.com> https://api.tidepool.org/auth/login
After pressing Enter/Return you will be prompted for your password. You may not see anything appear as you type in the password. This is normal. After inputting your password, press Enter/Return on your keyboard.
You will then receive a blurb similar to:
HTTP/1.1 200 OK access-control-allow-headers: authorization, content-type, x-tidepool-session-token access-control-allow-methods: GET, POST, PUT access-control-allow-origin: * access-control-expose-headers: x-tidepool-session-token access-control-max-age: 0 content-type: application/json date: Wed, 10 Feb 2016 21:00:21 GMT x-tidepool-session-token: eXYZyJhbGciOiJIUzI1NiaIsInR5cCI6IkwerwpXVCJ9.eyJkdXIiOjIuNTkyZSswNiwiZXhwIjox12345zMwMDIxLCJzdnIiOiJubyIsInVzciI6ImI0NTFhNmEwNDcifQ.WolTlCFxCIJjf5AbjabcdePqXztSxezUYzY-gwIJH-g Content-Length: 170 Connection: keep-alive
{"emailVerified":true,"emails":["youremail@email.com"],"termsAccepted":"2016-01-12T21:31:05-08:00","userid":"0460512abc","username":"youremail@email.com"}
The two important parts of this response are:
- x-tidepool-session-token: eXYZy...IJH-g in this example
- unique userID for your account: 0460512abc in this example
You will then take your Session Token and userID and use them in a new query:
curl -s -X GET -H "x-tidepool-session-token: <your-session-token>" -H "Content-Type: application/json" 'https://api.tidepool.org/message/notes/<userid>' > data_download.json
Again, please replace <your-session-token> with your actual x-tidepool-session-token value, and replace <userid> with your userID value from above. You can change "data_download.json" to any file name you like.
Optionally, specify start time and end time in ISO date/time format (e.g. "?starttime=2015-10-10T15:00:
After hitting enter, a file called data_download.json will appear on your computer. The easiest way to find this file is to search for it by name using your computer's search functionality.
Please reach out to support@tidepool.org if you have any questions or feedback on this article.