Guys, I am at my wits end!! Please help... I am executing an API via Google... and it works perfectly (moving folders into another folder)... however, the same call via my Delphi code will not work! Through Delphi, I can create the folders , I can rename them... but I cannot change their parents! I am doing exactly what it's asking me to do!

Guys, I am at my wits end!! Please help... I am executing an API via Google... and it works perfectly (moving folders into another folder)... however, the same call via my Delphi code will not work! Through Delphi, I can create the folders , I can rename them... but I cannot change their parents! I am doing exactly what it's asking me to do!

Here's the code....

RESTResponseDatasetAdapter1.AutoUpdate := false;
RESTRequest1.Params.Clear;
RESTRequest1.ClearBody;
RESTRequest1.Method:= rmPATCH;
RESTClient1.BaseURL := 'https://content.googleapis.com/drive/v3/files/'+edtMOveFolderSource.Text;

Folder := TJSONObject.Create;
Folder.AddPair(TJSONPair.Create('addParents', edtMoveFolderDest.Text));
rsr1.AddBody(Folder);

try
RESTResponse1.Execute;
Memo1.Text := rsp1.Content;
except
on e: Exception do
ShowMessage(e.Message);
end;

ps:
I have got authentication done.... and I can create a new folder , rename the folder and even upload the file (to the root). But this API gives me the right result. But it doesn't do anything.

However, from the google API site, the same function work... in the Try It sectoin. But when I do the same from Delphi, it wont work. :-( I have the Raw https call (from Firefox) so I am guessing, that I am screwing up some place in creating the request (not one my strenghts) :-)

Comments

  1. oh crap! lol! man I have been consumed by so much that I didn't even realise... sorry!

    ReplyDelete
  2. Hey Attila... thank you for your interest... I have managed to solve all issues. I am going to post the solution ASAP

    ReplyDelete

Post a Comment