Spotify API Import Example

Hello,

I’m trying to us the Example Spotify API to learn how to use Parabola. I’m stuck on the 400 error:
{
“error”: {
“message”: “invalid id”,
“status”: 400
}
}

Here are some screenshots of my configuration:

Funny timing. I was doing the same thing last Friday.

If you’re interested in exploring the data, I’d recommend you use the client credentials flow in their documentation, rather than the full Oauth.

Here are the settings to get a token

POST
https://accounts.spotify.com/api/token?grant_type=client_credentials

Headers:
Authorization Basic: (Base 64 encoded client_id:secret key)
Content Type: application/x-www-form-urlencoded

You need to take your client and id key and paste it into a base 64 encoder to get the correct format.

Just wanted to quickly follow up on this! Right now Parabola doesn’t support client credentials, so Authorization Code flow will need to be used.

So I would need to use the headers formatted as is just swap in my client id and secret?

Hey Dion! Your configuration looks really close. We can definitely connect to Spotify using OAUTH2, so let’s keep going down that route. First, can you “x” out of the Authorization Custom Header that you have configured in your screenshot. I think that might actually be causing an issue.

Here are the screenshots of the OAUTH configuration. Can you match your configuration?

Let us know how that goes!

2 Likes

Hi Sachi!

Thanks for the feedback and it actually did work when I changed the endpoint to look at my profile: https://api.spotify.com/v1/me.

However, I still get an “invalid Id” for other endpoints. I believe it may be expecting me to pass an id with the other endpoints so I’ll look into in their docs further.

Dion

Okay! Happy to look things over if you need help. Post some endpoints that you’ve tried that’s throwing the “Invalid ID” error.

Here are a few:

I noticed it is a required field in their dev console. I just need to read up a bit because I found others that do not require it:

https://api.spotify.com/v1/browse/new-releases?country=US&offset=0&limit=20

Thanks!

UPDATE: Those 2 endpoints require a comma-separated list of the Spotify IDs.

Yep, that’s correct. Those endpoints /artists and /shows do require IDs while /new-releases does not.

Depending on your use case, you might want to use the API Enrichment step to enrich data using the Spotify API. For example, you can start with a spreadsheet listing artists. You can then you the API Enrichment step to search Spotify via their API. The endpoint here would be:
https://api.spotify.com/v1/search?q={your column name}&type=artist

This would enrich your list of artists with data from Spotify including the Artist ID represented in the column api.id.

Nice! That was my next approach to determine the best way to query the API using Parabola.

Thanks for your direction!

Dion

2 Likes