编程语言
首页 > 编程语言> > php – 需要使用包装器从soundcloud API调用简单请求

php – 需要使用包装器从soundcloud API调用简单请求

作者:互联网

我正在使用主声音包装器(https://github.com/mptre/php-soundcloud)尝试将我的帐户中的曲目拉到我的网站上.我只是通过访问查询(我的用户名已经更改并且不是唯一的,因此我需要更改查询),但整个过程非常有效.所以我需要请求的就是“https://api.soundcloud.com/users/isound604/tracks.json”,如果您在API控制台中检查,您将看到它返回我的曲目.

我的问题是我不知道如何使用包装器发出此请求.我以前用过:

$string = $soundcloud->get('tracks', array('q' => 'beatmanshan', 'order' => 'created_at'));

但新请求似乎不适用于该功能.任何人都可以解释这个问题吗?请提前谢谢!如果您需要更多信息,请告诉我.

解决方法:

你已经使用api验证了吗?去检查

$my_details = json_decode($soundcloud->get('me'));

应该返回您的帐户详细信息

如果是这样你试过

$string = $soundcloud->get('users/isound604/tracks', array('order' => 'created_at'));

标签:php,request,wrapper,soundcloud,api
来源: https://codeday.me/bug/20190710/1419370.html