How do I stream a SoundCloud users tracks?

时间:2016-02-03 03:39:27

标签: java android soundcloud

This is the very first app that I am building, so I am not very knowledgeable. I have followed to tutorial here http://www.sitepoint.com/develop-music-streaming-android-app/ and created a very simple music streaming app. However, it only streams whatever random songs that come from I am not really sure where. I have researched and found that the endpoint should be /users/{userid}/tracks. But I guess I am not completely sure how to implement this. I adjusted the URL from the base endpoint to many combinations of the the (https://api.soundcloud.com/users/{userid}/tracks) I can think of or see. Am I changing the wrong thing? Do I need to change more the just the stored URL?

Extra information - Using android studio - can't post api reference link because of low reputation but its not hard to find

1 个答案:

答案 0 :(得分:0)

您拥有的api端点是正确的,但您需要在每次请求时传递clientId。注册SC开发人员here。如果您的clientID为9038420384208424,则您的api呼叫请求应如下所示:

api.soundcloud.com/users/duvetcover/tracks/?client_id=9038420384208424&limit=200&linked_partitioning=1

&limit=200&linked_partitioning=1是可选参数。 limit参数将指定要显示的条目数。最大值为200. linked_partitioning=1允许分页。它在请求结束时提供next_href键,以便您可以访问下一页的关注者,收藏夹,曲目或您要查询的任何内容。