Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oura v1 API Endpoints Removed #4

Open
MarshalX opened this issue Jan 23, 2024 · 21 comments
Open

Oura v1 API Endpoints Removed #4

MarshalX opened this issue Jan 23, 2024 · 21 comments

Comments

@MarshalX
Copy link

MarshalX commented Jan 23, 2024

Hi @phautamaki, thank you for your awesome work! Oura removed v1 API endpoints :(

The V1 API was removed on January 22nd, 2024.

We should migrate to v2 https://cloud.ouraring.com/v2/docs

@nic-oura
Copy link

I’ve been searching Reddit this morning to see if anyone else was encountering issues, and it seems they are. I appreciate this shortcut so much, and would be so grateful if it could be updated? I wouldn’t know where to start but will be so happy if Petri posts an update.

@MarshalX
Copy link
Author

MarshalX commented Jan 24, 2024

I fixed temperature sync and HRV & RHR sync. It wasn't a big effort but i dont want to maintain it so let's wait for the @phautamaki official fix. The major changes are:

  • access token must be passed in headers instead of query params
  • a lot of changes in JSON structure (inner object, renamed fields)
  • A 5min interval for HRV and RHR is still here but... It could be dynamic now (IG). we have a brand new field "interval" that we should respect
fixed temperature sync: image

@phautamaki
Copy link
Owner

Cool that you've found a way to make the upgrade @MarshalX! Unfortunately, I have a lot of things going on at the moment, so I'm not sure when I'll be able to look into this. 😮‍💨

Out of curiosity: what are you doing with the temperature deviation information? I'm thinking should that be included in the shared shortcut also. 🤔

@MarshalX
Copy link
Author

Out of curiosity: what are you doing with the temperature deviation information? I'm thinking should that be included in the shared shortcut also. 🤔

ah sorry i thought that this shortcut was yours too xd ig it is mine based on some reddit's comment. sorry

im just doing 37 + temperatureDeviation and write to "Basal Body Temperature" which gives me a graphic of how it changes from time to time. i don't care about precise values

@nic-oura
Copy link

Sadly this goes way over my head @MarshalX. Is there any chance you’d be able to share your fix?

@MarshalX
Copy link
Author

@nic-oura personally im using only "Sync Oura RHR & HRV (v2) " shortcut which runs automatically on closing of the "Oura" app. It doesn't support importing history or entering specific days. Only the current day. will it be enough for you?

@phautamaki
Copy link
Owner

im just doing 37 + temperatureDeviation and write to "Basal Body Temperature" which gives me a graphic of how it changes from time to time. i don't care about precise values

Yes, I looked in to this sometime earlier but didn't implement support because the API only gives the deviation information. But in case you're not interested about precise values then that seems a reasonable thing to do.

@nic-oura
Copy link

Hi @MarshalX thats exactly what I am using too, but didn’t actually realise it worked automatically on closing the app. I manually go into shortcuts each day and activate it! That’s how I noticed it wasn’t working. I’d be so grateful if you’re willing to share.

@MarshalX
Copy link
Author

Okay, there is the fixed version that also respects the new "interval" field. But pls don't ping me to fix it again or to tune it for your needs xd i just fixed it for myself

Sync Oura RHR & HRV.shortcut.zip. Pass your token to the "Text" field in case app will not ask you about your token.

It works completely silently and only notifies about successful imports. btw here is how to automate it on the "Oura" app closing:

press "Automation" at the bottom of the "Shortcuts" iOS app: image
create a new automation with the same params and pick the sync shortcut: image

@nic-oura
Copy link

Really appreciate this, thank you @MarshalX and of course won’t ask again. I’ll try and learn how it works myself ahead of any further changes. Thanks again.

@nic-oura
Copy link

Sadly the fix doesn’t work for me. Not sharing because I expect anyone to change it but to highlight in case anyone else joins the thread. It pulled in all HRV rather than just nighttime and so is disproportionately high. I think perhaps, for me, it’s time to give up on athlytic, which is a shame as I love the data but the complex shortcuts required will always be a bit too complicated for me. Thanks for your help @MarshalX and I’ll keep an eye out @phautamaki in case you get time to update. Take good care.

@nic-oura
Copy link

nic-oura commented Jan 26, 2024

On checking, it’s not pulling in the wrong data, it just didn’t work, for me. Although it seems to yesterday. I suspect this may be human error on my part. Apologies.

@MarshalX
Copy link
Author

MarshalX commented Jan 26, 2024

Good morning! Today Oura recorded 2 sleep sessions (i didn't have a nap). And that session is sooooo weird. Duration about 40 min, lowest heart rate is 255 xdddd. so they have a problem.

and yeah, with such a strange data shortcut don't import it because it didn't originally support more than 1 sleep session (see the readme of this repo for more info).

but i added one more loop over sleep sessions in the shortcut and now it works with such strange cases.

moreover, it should support naps too but only if you will run a shortcut after taking a nap and don't run it after the main session

Sync Oura RHR & HRV.shortcut.zip

@nic-oura
Copy link

Such a strange situation, shortcuts isn’t putting anything in Health for me, even with your new file… It’s very odd. I was awake for a long period in the early morning so perhaps somehow it’s prevented it from working properly due to the odd Oura data.

@nic-oura
Copy link

Update: it did it! Thank you so much @MarshalX, if you have a Kofi account, let me know :)

@MarshalX
Copy link
Author

MarshalX commented Jan 27, 2024

It creates duplicates in records. Probably need to fix the work with dates. It creates records again for the previous day

upd. i added one more if statement inside the loop through sleep sessions. compare "date" from JSON to the current date. works good

image

@nic-oura
Copy link

Thanks @MarshalX, where did you add this, right at the end?

@MarshalX
Copy link
Author

Thanks @MarshalX, where did you add this, right at the end?

Sync Oura RHR & HRV.shortcut.zip

@babadabeep-lab
Copy link

Thanks @MarshalX! What is the best way to update this shortcut so that it works in timezones where the ISO 8601 timezone offset is negative? Similar to the ‘alternative’ shortcut design from @phautamaki. Trying to make what I think the necessary changes are myself, but am unable to edit. All of my HRV data for the previous night comes through as 12pm for the day I wake up in the apple health app.

@nic-oura
Copy link

Thanks @MarshalX, I don’t see any duplicates but to be safe have used your update. So appreciative, thank you!

@cyberwool
Copy link

cyberwool commented Apr 3, 2024

@babadabeep-lab I just came across this repo and made an alternative version of the updated shortcut by @MarshalX to work with negative offset timezones. I’ll put it here for anyone who’s interested.

Sync Oura RHR & HRV (alternative).zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants