0

I am using SharePoint REST API with python to move a file using the below URL

move_url = app_site + "/sites/" + sitename + "/_api/web/getfilebyserverrelativeurl(@SrcFile)/moveto(newurl=@DestFile,flags=1)?@SrcFile=" + src_file_to_dwnld + "&@DestFile=" + dest_file_to_downld + ""

The filename has a ' character in the name .e.g example Dec'd.pdf.

I am always getting a response with the error message saying The query string "serverRelativeUrl" is missing or invalid

I came across this site where it says

It must not contain the following illegal characters: [!#$&'+:<>?\{|}~]|(//)|(..)|(/_)|(/wpresources$)|(/wpresources/)

I tried to follow the solution provided in this question to escape the character by using '' but getting a 404 file not found error.

Is there anything am I doing wrong here?

user2720864
  • 8,015
  • 5
  • 48
  • 60

1 Answers1

1

I tested this issue on my SPO library and it works well if i replace quote with double quote.

enter image description here

Baker_Kong
  • 1,739
  • 1
  • 4
  • 9
  • Yes, this is working, there was a problem while creating the URL causing this to failed. After you confirmed I doubled checked it and now it is working. Thanks for your help. – user2720864 Apr 28 '20 at 08:47