SoundCloud created_at [from]查询解决了503错误

时间:2014-02-26 19:44:40

标签: api soundcloud

使用JavaScript SDK,我试图从给定日期开始搜索给定类型中的所有曲目(使用'created_at [from]'/ tracks过滤器)。

我的JavaScript是:

SC.get('/tracks', { genres: 'metal', created_at: {from: '2014-02-26 00:00:01'} }, function(tracks) {
  console.log(tracks);
});

请求网址解析为:

http://api.soundcloud.com/tracks?genres=metal&created_at[from]=2014-02-26%2000%3A00%3A01&client_id=MY_ID

我得到了503.(我在此故意忘记发布我的client_id)

我在这里做错了什么?

1 个答案:

答案 0 :(得分:0)

看起来他们更改了过滤器或它的错误或他们正在处理它:

当我打电话时:

http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=2010-10-10

我得到了:

invalid filter.created_at=2010-10-10; 
valid values are: last_year, last_two_weeks, last_week, last_day, last_hour

然后,当我打电话给最后一小时:

http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_hour

我得到的是:503 - 服务不可用

当我将其更改为last_year时,它按预期工作, 我得到以下xml(或json):

<tracks next-href="http://api.soundcloud.com/tracks?client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_year&genres=metal&limit=1&offset=1" type="array">
<track>
<kind>track</kind>
<id type="integer">103909859</id>
<created-at type="datetime">2013-08-04T01:30:44Z</created-at>
<user-id type="integer">29394873</user-id>
<duration type="integer">248917</duration>
<commentable type="boolean">true</commentable>
<state>finished</state>
<original-content-size type="integer">4696472</original-content-size>
<sharing>public</sharing>
<tag-list>
exotoxis metal femalevocals rock shredding army god double bass
</tag-list>
<permalink>army-of-god</permalink>
<streamable type="boolean">true</streamable>
<embeddable-by>all</embeddable-by>
<downloadable type="boolean">false</downloadable>
<purchase-url nil="true"/>
<label-id nil="true"/>
<purchase-title nil="true"/>
<genre>Metal</genre>
<title>Army Of God</title>
<description>
For more Information plea

编辑: 我说你是对的,SC团队应该给出答案。