Get user ID - WebAPI Spotify (Spotipy) - spotify

my question
is possible get a user id in any way? I would search a user from his name and print his recently artist played
Thanks

This is not possible due to Spotify's Web API has no endpoint where you can fetch user ids by their names.
What you can do is creating an application where a specific user can login using Spotify. Afterwards you can use this endpoint in order to retrieve the recently played tracks of that exact user. The track object in the response will hold the artist as well.

Related

How do I post as different users in react-activity-feed component using the same token?

Our Use case is Anyone can create a site in our platform bit as Wix lets say. Each Site has its own Community & Chat.
So I used my appId, secret key to create the user session token for the user of the site1 says site-1-user-1 for displaying the community of site1.
I used react-activity-feed components to display the timeline feed of user site-1-user-1 (timeline:site-1-user-1)
I also displayed status update from above the activity feeds using react component. So when I post in this status update form, the activity gets displayed as by site-1-user-1.
How do I post activity as a different user say site-1-user-2 using the same token? I want the timeline feed with status update form to be displayed as a discussion forum where any logged in user can post any topic and see other activities also.
I am able to do this using PHP and getStream SDK.
How is it possible by using the react component?
Stream restricts actions user is able to perform when using client-side tokens:
User is able to read any feed
User is able to make feeds with her user-id follow any feed
User is able to post to feeds with her user-id
Client side tokens can only be used to perform the actions as the user the token was created for.
If you need to be able to impersonate other users or post contents for users to feeds they have no access to you will have to user server-side stream api

Is it possible to check whether a user has access to Spotify for Artists for a specific artist?

I am trying to automatically verify that a user is a particular Spotify artist (or at least on the artist's team). The problem is that an artist and a user are different. Spotify's authentication API deals with user accounts. However, user accounts are used to access Spotify for Artists and are internally verified by Spotify.
Therefore, it looks like I just need some way to check whether the user can access the artist. Is there any API or other way to check that a particular authenticated user is tied to a Spotify for Artists account?

Spotify API: Get user owned playlists only

During developing a little spotify widget I want to receive my playlists. This is no problem with the Spotify API but I need to get only the playlists where the owner is the current user.
Is this possible?
Thanks a lot!
Julian
Julian, there's no API endpoint to only retrieve the endpoints that the user has created. Instead, your application needs to retrieve the Current User's list of Playlists and loop through them to filter out the user's own playlists by the owner property. (See Playlist object for details.)
If you don't know the user's username, use the Get Current User's Profile endpoint.

instagram - get media from people you follow with private profile

I am using Instagram's User Endpoint in an attempt to retrieve media from people who I'm following.
I have a sandbox working with other members of my team, with each of us following the others.
I have authenticated myself through the server-side flow as indicated here and retrieved a list of ids of the people I follow (namely the members of my team) via the Relationship Endpoint.
In trying to get user media for those ids, however, I receive:
{"meta":{"error_type":"APINotAllowedError","code":400,"error_message":"you cannot view this resource"}}
Indicating an error because they have private profiles.
Is there anyway getting around this, seeing as I am actually an approved follower?
Thanks in advance.

FourSquare Venues API

I am a bit shaky on how to use the venues API in forusquare. My main question is related to OAuth. I want to be able to do venue searches on the server side of the system, and i need the server to login into foursquare automatically. It says on the website that foursquare doesn't require user authentication to use some of the venue functions, however whenever i try to do a call to: venues/categories without specifying an oath_token I get a permission error.
How can i do venue calls without having to use a user login?
Thanks in advance.
It would help if you had given the exact url you are trying to call, but in general:
The userless requests to Foursquare still require the client id and client secret that you get when you register the OAuth Consumer in foursquare.
Using the id + secret you can access Venue API endpoints without authenticating with a user.
So if I got to the Venues Categories endpoint you can see that it does not require and acting user and thus accessing:
https://api.foursquare.com/v2/venues/categories?client_id={0}&client_secret={1}&v={2}
Will get the categories list.
In that example, replace {0} with your client id, {1} with your client secret and {2} with whatever version date you feel comfortable with, today would be 20111218
More can be found here https://developer.foursquare.com/overview/auth#userless
you can use https://developer.foursquare.com/docs/explore#req=/venues/categories and in the view box use /venues/categories to see a list of all of the venue codes to use. then simply use:
https://api.foursquare.com/v2/venues/search?ll="+ ll+"&radius=10000&limit=50&categoryId="+catID+"&client_secret=xxx&client_id=xxx
in your call to load the url based upon ll which is long and lat and it will create a response of json object to parse. The App/Web site does not need to be authorized for such a search, and the limit goes to 5000 calls per hour, and you can increase this by emailing Foursquare with the application information and screen image of the app showing you credit Foursquare with the info, like a Foursquare button, etc. - Hope this helps.
Visit https://foursquare.com/developers/apps to get your API keys. Once you click "Create A New App", your Client ID and Client Secret should be visible.
Once you have your keys, try plugging them into this search:
https://api.foursquare.com/v2/venues/search?near=seattle,wa&query=coffee&v=20150214&m=foursquare&client_secret=xxx&client_id=xxx

Resources