我正在制作这种SoundCloud API请求:
https://api.soundcloud.com/tracks.json?q=electro&limit=10&client_id=<my-client-id-that-I-removed-intentionally>&created_at%5Bfrom%5D=2014%2F11%2F24%2012%3A03%3A04&offset=0
从最近以来,我得到了这样的答复:
代码:400,
身体:
{"errors":[{"error_message":"invalid filter.created_at[from] value: '2014/11/24 12:03:04'"}]}
根据官方文件,我的要求应该没问题: https://developers.soundcloud.com/docs/api/reference#tracks
如果我做错了,你能告诉我吗?
感谢您的支持。
答案 0 :(得分:1)
问题在于日期格式。 docs说破折号应该在日期中使用:
created_at[from] date (yyyy-mm-dd hh:mm:ss) return tracks created at this date or later
所以当你指定这样的日期时它会起作用:2014-11-24 12:03:04
(不带斜杠)。
我们SoundCloud最近更改了API的行为,以便为过滤器中的所有类型的无效输入返回错误,以便更清楚地了解允许的内容和可以预期的内容。