I do not seem to manage the file copy operating using the dropbox api. I can successfully authorize my client, download and upload files. The copy operation needs POST method to be used and I think this is where I produce wrong request. I am defining the POST Method for OAuth Authentication and use Indy TIdHTTP to Post the request, but I always receive the error code 403 - Permission denied.
Here is the dropbox api description: https://www.dropbox.com/developers/reference/api#fileops-copy
Here is part of my code:
ParamStr := Format('root=%s&from_path=%s&to_path=%s', [Root, EncodeFileName(FromPath), EncodeFileName(ToPath)]);
URL := 'https://api.dropbox.com/1/fileops/copy' + '?' + ParamStr;
Consumer := TOAuthConsumer.Create(Key, Secret);
AToken := TOAuthToken.Create(fToken, fTokenSecret);
HMAC := TOAuthSignatureMethod_HMAC_SHA1.Create;
ARequest := TOAuthRequest.Create('');
try
ARequest.HTTPURL := URL;
ARequest.Method := 'POST';
ARequest := ARequest.FromConsumerAndToken(Consumer, AToken, '');
ARequest.Sign_Request(HMAC, Consumer, AToken);
Params := TStringList.Create;
try
Params.Text := ParamStr + '&' + ARequest.GetString;
HTTP.Post(URL, Params);
finally
Params.Free;
end;