I’m trying to build a playlist editor on macOS. I can create playlists via the Apple Music HTTP API, but DELETE always returns 401 even immediately after creation with
the same tokens.
Minimal repro:
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="https://api.music.apple.com/v1"
PLAYLIST_NAME="${PLAYLIST_NAME:-blah}"
: "${APPLE_MUSIC_DEV_TOKEN:?}"
: "${APPLE_MUSIC_USER_TOKEN:?}"
create_body="$(mktemp)"
delete_body="$(mktemp)"
trap 'rm -f "$create_body" "$delete_body"' EXIT
curl -sS --compressed -o "$create_body" -w "Create status: %{http_code}\n" \
-X POST "${BASE_URL}/me/library/playlists" \
-H "Authorization: Bearer ${APPLE_MUSIC_DEV_TOKEN}" \
-H "Music-User-Token: ${APPLE_MUSIC_USER_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"attributes\":{\"name\":\"${PLAYLIST_NAME}\"}}"
playlist_id="$(python3 - "$create_body" <<'PY'
import json, sys
with open(sys.argv[1], "r", encoding="utf-8") as f:
data = json.load(f)
print(data["data"][0]["id"])
PY
)"
curl -sS --compressed -o "$delete_body" -w "Delete status: %{http_code}\n" \
-X DELETE "${BASE_URL}/me/library/playlists/${playlist_id}" \
-H "Authorization: Bearer ${APPLE_MUSIC_DEV_TOKEN}" \
-H "Music-User-Token: ${APPLE_MUSIC_USER_TOKEN}" \
-H "Content-Type: application/json"
I capture the response bodies like this:
cat "$create_body"
cat "$delete_body"
Result:
Create: 201
Delete: 401
I also checked the latest macOS SDK’s MusicKit interfaces and MusicLibrary.createPlaylist/edit/add(to:) are marked @available(macOS, unavailable), so I can’t create/
delete via MusicKit on macOS either.
Question: How can I implement a playlist editor on macOS (create/delete/modify) if:
MusicKit write APIs are unavailable on macOS, and
The HTTP API can create but DELETE returns 401?
Any guidance or official workaround would be hugely appreciated.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
So - I'm trying to add the device capability requirement
iphone-ipad-minimum-performance-a12
which seems to map to exactly the capabilities I actually need, which is "supports avcapturemulticamsession"
but I just get this error when trying to validate:
App Store Connect Operation Error
This bundle is invalid. The key UIRequiredDeviceCapabilities contains value 'iphone-ipad-minimum-performance-a12' which is incompatible with the MinimumOSVersion value of '13.5'.
What am I doing wrong?
Does apple expose any apis to manipulate a Memoji programatically? I find Apple's way of creating memojis extremely unpleasant to use - and would like to create an alternative.
So I'd essentially be looking at some way of listing the parameters available (eye colour, hair style etc) - listing the set of choices for each parameter, and producing a Memoji from a set of parameters. (And for extra credit, taking a picture of said memoji, or reading an existing emoji as a set of parameters).
Thanks,
Darren