Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Plan
Premium
Device
(iPhone 12)
Operating System
(iOS 15)
My Question or Issue
Hi. I'm using iOS Shortcuts app as a low code environment for some simple Spotify API activities. Authentication is working and I'm able to GET and POST with other Spotify APIs (e.g. update playlist tracks, update playlist description). As other forum posts have observed, there's not a lot of detail on how to actually use the Add Custom Playlist Cover Image API. I've authenticated the app with ugc-image-upload, playlist-modify-public, playlist-modify-private scope.
I'm making a PUT call to https://api.spotify.com/v1/playlists/{my playlist ID}/images with headers Accept: application/json, Content-Type: image/jpeg (I've also tried application/json), and Authorization: Bearer {token}
I've encoded my image filed with base64 and confirmed there's no preface text with image/jpeg. My question is how to actually post the encoded image data? I don't think it's part of the URL call (https://api.spotify.com/ ... /images/image=), but rather in the request body. But using a tag of some kind, as a file, etc? All of my various attempts are generating a 400 error: "Bad request"
Can anyone shed more light on this? Any verified examples to point to that would show URL, header and body elements? Thanks!
did you ever figure this out by any chance? Trying to do something similar and running into the same issue.
5 minutes ago I would have said, still no luck, but I changed one parameter and actually had success for the first time. The trick seems to have been in the encoding -- looks like there may have been line breaks (every 64 characters) that was messing this up. Switching to no line breaks and sending the encoded image as a file is working for me now.
Think you could provide an example of this? Thanks!!
I’m not sure how much iOS Shortcuts pseudo code will help here. Here’s a sample shortcut that gets a random Bob’s Burgers image and encodes to base64. https://www.icloud.com/shortcuts/3cc13e2e68dc45598bd56792fb01044a
Once I have the encoded image, I pass that to the Spotify endpoint using PUT, content type image/jpeg, and the encoded image in the body request. Hope that helps a little.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…