我正在通过关注Deezer文档并使用servicePath“user / me”发出请求来阅读用户的信息。我收到用户ID并尝试使用以下路径发出请求:
NSString* playlistPath = [NSString stringWithFormat:@"playlist/%@", self.deezerID];
DeezerRequest* request = [_deezerConnect createRequestWithServicePath:playlistPath
params:nil
delegate:self];
[_deezerConnect launchAsyncRequest:request];
NSLog(@"Path: %@", playlistPath);
我收到了以下信息:
/* Delegate methods */
#pragma mark - DeezerRequestDelegate
- (void)request:(DeezerRequest *)request didReceiveResponse:(NSData *)data {
NSError *error;
id myJSON = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
NSDictionary *jsonDic = (NSDictionary *)myJSON;
if (error != nil) {
NSLog(@"Error parsing JSON.");
}
else {
NSLog(@"Dictionary: %@", jsonDic);
}
self.deezerID = jsonDic[@"id"];
}
问题是我收到以下错误:
Dictionary: {
error = {
code = 800;
message = "no data";
type = DataException;
};
}
这是什么意思?我是否正在提出正确的请求以检索用户的播放列表及其曲目?
我想要做的是获取USERs播放列表并允许他将WebService分享给另一个用户。这甚至可能吗?
答案 0 :(得分:1)
您必须改为查询用户端点:user / USER_ID / playlists。 您只能将播放列表端点用于播放列表ID。 文档在这里:http://developers.deezer.com/api/user/playlists