2012-07-31 122 views
1

這可能是一個非常簡單的答案,但我對Soundcloud API不熟悉,所以任何幫助將不勝感激。Soundcloud API(PHP)客戶端驗證

我想用PHP訪問Soundcloud API以訪問用戶詳細信息。 我通過我的個人soundcloud帳戶激活了我的應用程序,從而獲得了soundcloud CLIENT_ID,但在訪問其他公共用戶信息時似乎不起作用。

CLIENT_ID是否每個用戶更改?

該應用程序是否需要每個用戶驗證/接受才能訪問歌曲列表等信息......(或可否驗證一次)?

回答

1

CLIENT_ID標識您的應用程序。包含CLIENT_ID的請求可以讀取任何公共信息。只有CLIENT_ID可提供用戶信息的子集。例如,URI

http://api.soundcloud.com/users/12840173.json?client_id=A_CLIENT_ID 

將返回以下JSON:

{ 
    id: 12840173 
    kind: user 
    permalink: paultest 
    username: paultest 
    uri: http://api.soundcloud.com/users/12840173 
    permalink_url: http://soundcloud.com/paultest 
    avatar_url: http://i1.sndcdn.com/avatars-000015469869-jcyh92-large.jpg?330b92d 
    country: Canada 
    full_name: Paul Osman 
    description: null 
    city: Toronto 
    discogs_name: null 
    myspace_name: null 
    website: null 
    website_title: null 
    online: true 
    track_count: 17 
    playlist_count: 4 
    public_favorites_count: 1 
    followers_count: 1 
    followings_count: 1 
} 

爲了獲取非公開信息(如私有軌道,賬戶計劃等),你必須有用戶授權你的申請。有關我們的OAuth實施的更多信息,請參閱the documentation for authorizing server-side web applications

希望有幫助!

+0

是的,謝謝:) – mlishn 2012-07-31 20:45:36