API bug - Get Sport Settings (Zones etc)

Hi David, and others using the excellent API,

I’ve been playing around recently with importing my intervals.icu zones for my various sports into a Google sheets document with the following API call: /api/v1/athlete/{id}/sport-settings

The API call then gets put into a standard data table format using some open source code: ImportJSON | Fast Fedora | Trevor Lohrbeer

This was working fine for I would guess a week or so, on an hourly basis since I have automated the sheet to call the API at that regularity. However, this failed yesterday (logged at 2023-01-28 21:15:08 GMT) and has not functioned since. The error I get says “Exception: The number of columns in the data does not match the number of columns in the range. The data has 57 but the range has 59.”

So I assume something has recently changed there and not been properly reflected in the API (hence the bug report). Although if anyone has similarly come across this (or a similar) issue and got a workaround, I’d be very happy for some advice!

I’ve not been having / seeing issues, although I’ve been using /api/v1/athlete/{id}/ instead

Thanks for the reply, I’m not currently using that call but will give it a try - looks like it has a lot of data in so a good one to use in general.

Depends on what you need it for. Won’t calling it 1x suffice? I’m guessing that it shouldn’t change frequently.

No zones won’t change frequently; I could use a less frequent time based trigger.

Maybe it is failing because sport settings has some extra fields? “activity_charts” was added on the 22nd. In general objects returned by the API will get new fields from time to time as features get added.

Thanks for the info, I’ll look into that to see if that’s where my script is going wrong.