2011-12-18 69 views
1

Using the advice in this post我已經能夠訪問用戶的數據

 
sp = getSpotifyApi(1); 
console.log (sp.core.library.getAlbums());     

我要訪問Spotify的用戶數據登錄到應用程序的用戶訪問Spotify的用戶數據,其播放列表,特別是Spotify的uri給用戶。

 
sp = getSpotifyApi(1); 
console.log (sp.core.user);  // is undefined 
console.log (sp.social.relations); // is undefined 

我該怎麼做?

回答

2

出於隱私原因,此信息在Spotify應用程序API中不可用。有一個唯一的用戶標識,但它不是用戶的用戶名。

如果你需要用戶的朋友列表,你需要自己連接(說)Facebook,並得到它。

+0

有沒有辦法訪問唯一的ID? – Ben 2011-12-20 00:01:23

+0

目前,有'sp.core.getAnonymousUserId()',但不支持(就像'sp.core'中的所有內容一樣)。一個「真正的」API即將推出。 – iKenndac 2011-12-20 15:20:17