API access to Intervals.icu

@david let me know if i’m doing something wrong. I’m trying to improve the workout library sync.

For workouts which I created by myself (either created by hand or dragging existing workouts to the library folder), I have no issues using the API to download the JSON it.

basically sending a GET to
let url = “https://intervals.icu/api/v1/athlete/\(athleteId)/workouts/\(workout.id)

then POST to
https://intervals.icu/api/v1/athlete/\(athleteId)/download-workoutjson

However, when i copy any workouts that is available from the public workout library into my own Library,

eg: Gerries Workout

Doing the same process, it will fail with the error:

Download Error: requestError[Error Domain=OAuthSwiftError Code=400 "Required request body is missing" UserInfo={NSLocalizedDescription=Required request body is missing, Response-Headers={
    "Access-Control-Allow-Origin" = "*";
    "Content-Length" = 57;
    "Content-Type" = "application/json;charset=UTF-8";
    Date = "Fri, 07 Jun 2024 13:03:29 GMT";
    "Strict-Transport-Security" = "max-age=15724800; includeSubDomains";
}, OAuthSwiftError.response=<NSHTTPURLResponse: 0x6000037f99c0> { URL: https://intervals.icu/api/v1/athlete/{athleteId}/download-workoutjson } { Status Code: 400, Headers {
    "Access-Control-Allow-Origin" =     (
        "*"
    );
    "Content-Length" =     (
        57
    );
    "Content-Type" =     (
        "application/json;charset=UTF-8"
    );
    Date =     (
        "Fri, 07 Jun 2024 13:03:29 GMT"
    );
    "Strict-Transport-Security" =     (
        "max-age=15724800; includeSubDomains"
    );
} }, OAuthSwiftError.response.data={length = 57, bytes = 0x7b227374 61747573 223a3430 302c2265 ... 69737369 6e67227d }, NSErrorFailingURLKey=https://intervals.icu/api/v1/athlete/{athleteId}/download-workoutjson, Response-Body={"status":400,"error":"Required request body is missing"}}]

when issuing a GET to one of my own libraries, i will get a response which can then be converted to JSON. But for the shared libraries, copied to my own library, nothing gets returned.