2013-03-14 24 views
0

有關在Soundcloud中使用API​​的另一個問題(我正在使用PHP)。Soundcloud中的日期 - API

我會上傳大量聲音,其中一些聲音記錄在1994年左右。我希望能夠使用搜索API來檢索具有此日期的文件。

我可以看到軌道資源包含[release_day],[release_month]和[release_year] - 但這些字段在查詢中似乎不可用作過濾器,是正確的嗎?

所以,如果我不能使用這些字段的日期搜索,我能想到的唯一的其他選擇是使用[created_at]字段,因爲這可以在搜索中使用。

只是 - 我已經試過,但我似乎不能夠修改那件使用API​​數據。我成功地修改元數據的其他部分,但是,例如(使用PHP代碼段):

$client->put('tracks/' . $track->id, array(
     'track[created_at]' => "1994/03/14 07:35:57 +0000", 
     'track[description]' => 'This track was recorded in Berlin' 

)); 

,沒有任何效果,這我相信意味着我不能做什麼,我需要做什麼?

我該如何解決這個問題,並允許我網站上的用戶搜索1994年或類似錄製的聲音文件?

非常感謝。

回答

0

首先,查詢跟蹤,每個文件,方法是:

created_at[from] date (yyyy-mm-dd hh:mm:ss) return tracks created at this date or later 
created_at[to] date (yyyy-mm-dd hh:mm:ss) return tracks created at this date or earlier 

目前沒有工作,與許多其他查詢上的SoundCloud的。

除了它作爲查詢被破壞之外,created_at時間戳是在軌道上傳時添加的,並且是不可修改的。通過釋放相關的參數來搜索的唯一方法是通過諸如其子資源的一個第一搜索:

GET  /users/{id}/tracks list of tracks of the user 
GET  /users/{id}/playlists list of playlists (sets) of the user 
GET  /tracks/{id}/comments comments for the track 
GET  /tracks/{id}/comments/{comment-id} a comment for the track 
GET  /tracks/{id}/favoriters  users who favorited the track 
GET  /tracks/{id}/favoriters/{user-id} a user who has favorited to the track 
GET  /tracks/{id}/shared-to/users users who have access to the track 
GET  /tracks/{id}/shared-to/emails email addresses who are invited to the track 

,然後過濾基於軌道的釋放性的結果。因此,例如,您可以通過/ users/{id} /播放列表進行搜索,然後按發佈日期對該播放列表中曲目的結果進行過濾。

+0

嘿,你能告訴我你的確切要求不適合你嗎?當你說「不行」時,你的意思是?你得到5xx錯誤還是4xx?謝謝! – 2013-03-15 10:33:27