Spotify web api, get follow playlist's tracks - spotify

I want to get the tracks of a playlist that I follow via de new Spotify Web API. The issue is that, if the playlist isn't created by me, I get a 404 Error.
Any ideas how to solve this?

For next time, please provide the exact URL that you're calling, along with query parameters or potential body parameters. It makes it a lot easier for people to help you.
My assumption of what's going wrong here is that you're providing your own username instead of the playlist's owner's username as part of the URL.
Endpoint documentation for Get a Playlist's Tracks:
GET https://api.spotify.com/v1/users/{user_id}/playlists/{playlist_id}/tracks
The user_id here is the playlist's owner's user id, and the playlist_id is of course the id of the playlist, e.g. 6sUmrBvbrRDDbaYJmO9DaE.

Related

Instagram graph API IG hashtag

I need to get media from connected instagram profile by hashtag. For most part, I was successful, however I stumbled upon a few limitation I cannot find workaround for.
When I fetch media on IG user, I can send username as a field and get it back. However, I cannot get username on IG hashtag, it is not listed as field in documentation, and throws error if I send one.
I don't want to get back albums on IG hashtag, just image and video, but I can't seem to find a way to filter by type
What is interesting, I found an example of site that displays username when filtering by hashtag, but the only way I could think of achiving this is to send request for media details for each media I receive. Needless to say, I want to avoid it.
Has anyone had a similar problem and solved it?

YouTube Data API LiveChatId assistance

I've looked online for quite some time now, and I have come up empty. I am working in C#, and I am trying to locate the code I can use to get the liveChatId so I can post to livestream chat. Even the "Try it now" section of Google's example resource https://developers.google.com/youtube/v3/live/docs/liveChatMessages/list#try-it asks for the liveChatId as well. I know I need to make a HTTP GET request, but I really need the actual code that will allow me to do this.
Assistance is GREATLY appreciated.
Here, from the very documentation you provided:
The liveChatId parameter specifies the ID of the chat whose messages will be returned. The live chat ID associated with a broadcast is returned in the liveBroadcast resource's snippet.liveChatId property.
That means you first need to get your liveBroadcast resource. You can obtain those at the liveBroadcasts.list endpoint. If you want to retrieve broadcasts that you (or a user of your application) is the owner of, you might consider authenticating with OAuth 2.0 and using the mine parameter.

Instagram this user does not exist

I'm trying to get medida data from Instagram via their REST service. I've got an access token and tried to get some media data, I'm using this query
https://api.instagram.com/v1/users/184692323/media/recent/?access_token=
I get this response
{"meta":{"error_type":"APINotFoundError","code":400,"error_message":"this user does not exist"}}
The user ID does exist, I actually tried to use Lady Gaga's user ID, which I got from here: http://jelled.com/instagram/lookup-user-id#
When I use my user-id, it works. It just seems to not work with other user ids.
What can I do? Is this something related to these new "sanbox" rules?
I think you are still running in Instagram Sandbox-mode: https://www.instagram.com/developer/sandbox/.
Citing their page: For example, if you query the /users/{user-id}/ endpoint and the {user-id} is a sandbox user, then you will get the normal API response; but if the {user-id} is not a sandbox user, you will get a APINotFound error.
I have the same issue for non-Sandbox users, which are public but nevertheless Instagram returns it's not a valid user. So the docs seem to be correct.
the user exits, but you may be blocked by instagram for spamming, usually you get that response if spam was detected by an account, try with different user access_token, it should work.
I am very late but you need to invite the user in your application's sandbox and he needs to accept your invitation to actually get any information out of it.
In addition to what Dennis said,
You need to submit your App for review if you're doing things with public profiles. It's not super complicated, but you'll need to build an actual use case for them to approve your app out of sandbox mode.
Or, you can add the users you want to play with to your sandbox app.

Do I require authorization from Spotify for isrc code?

I want to make a request to Spotify Web API, getting the isrc code based on song title and artist title.
Do I require authorization for this type of request?
No, you don't need to authenticate your request, though it's advisable if you are going to make lots of requests.
You would use the Search endpoint for finding tracks with a given title and artist name, and then you would get the data for the track using the Get a track endpoint.
There you can find the isrc code in the external_ids field.

Create app-bound playlist on Spotify

Is it possible to create an app-bound playlist?
It's possible to create a playlist for a user, but how will I know which one that is when they move away from my app?
Ideally, I would only need to be able to create/edit 1 playlist.
Edit: Have found this http://developer.spotify.com/technologies/apps/guidelines/integration/#appsthatcreateplaylisturi:s
But if anyone has great ideas, I'm still open!
As you've found out yourself, you can't create a playlist in a user's library that's somehow linked to your application using the Spotify Apps API.
I thought it'd be a good idea to also quote the relevant part of the Integration Guidelines that you've linked to:
If you want to generate and save the user’s personal playlists in the
app, you should not keep playlist information only saved within the
app. Playlist information should instead be handled by utilizing user
playlists, so that the user can access playlists as usual. They
shouldn’t have to go to the app to access a certain playlist that they
have created.
Suggestion:
I think there's several ways to do what you want to do though.
One way could be to let a user create a new playlist using your application and save it to the user's library, and at the same time save the playlist URI to your own back end. As you've noted, playlist URIs are obfuscated (e.g. they look like spotify:user:#:playlist:783BHaT7Xb8K5VyYstxsj3 instead of spotify:user:thelinmichael:playlist:783BHaT7Xb8K5VyYstxsj3, the username is replaced by # for the currently logged in user, and #xxx.. for other users). You could still save the last part of the URI, which I believe is unique for every playlist. Using a hashmap to map that part of the playlist URI to properties you want to keep track of would let you do quick lookups of a user's playlists to see if they are associated to your app. You could iterate though the user's library to gather all obfuscated URIs, and send them to your backend in a single HTTP request. The response from your server could be the index of the library playlists that matched the playlist on your backend, along with the properties you've mapped to it. Again, this was just a suggestion and possibly not the best way forward but I hope it gave you some ideas. :-)

Resources