SoundCloud APIを介してコメントを投稿したいのですが、ドキュメントを見ると不可能に/tracks/{id}/comments
思えます。利用できる唯一の方法はですGET
。送信しようとすると、POST
が表示されます。HTTP Error: 422
コンソールを使用した場合も同じように422が表示されますが、それでもパラメーターとして"error_message": "Body can't be blank"
追加しました。body=test
APIを介してコメントを追加する方法について何か考えはありますか?
たとえば、rubySDKを使用すると可能であるように思われます。
# create a new timed comment
comment = client.post("/tracks/#{track.id}/comments", :comment => {
:body => 'This is a timed comment',
:timestamp => 1500
})
しかし、私はObjective-C SDKを使用しており、これはこれまでの私のコードです(422を返します)。
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObject:content forKey:@"body"];
if (timestamp >= 0)
{
[dict setObject:[NSString stringWithFormat:@"%i", timestamp] forKey:@"timestamp"];
}
NSString *resource = [NSString stringWithFormat:@"tracks/%i/comments", trackId];
[scAPI performMethod:@"POST" onResource:resource withParameters:dict context:delegate userInfo:nil];