Forum Discussion
SharePoint REST API moveTo URL limitation
- Mar 24, 2017
Hi Brent
You can put the newUrl variable in a Dictionary.
The assign the Dictionary as the parmeters of the Call HTTP web service action.
The POST method will include it as payload.
then Build {...} Dictionary (Output to Variable: parameters)The pass the Dictionary to the Call HTTP web Service action...
The Call [My Site/MyList/MyItem etc.]/file/MoveTo() HTTP web service with Variable:parameters (Response Content to.....
Hope this helps,
Tony
Resurrecting this instead of posting a new one. I've just come upon this same issue. Is there no way to work around this?
This is a url for a POST that is 296 characters long (and SUCCEEDS) (259 char excluding the tenant) - replaced with b's, x's, and y's to protect the innocent, but the following depicts exact length
https://bbbbbbbbbbbbbb.sharepoint.com/sites/customer/plan/_api/web/lists/getbyid('34b6672e-531e-443e-86a8-eeb17eb9259f')/items(172)/file/moveto(newurl='/sites/xxxxxxxx/yyyy/151/bbb bbbbb bbbbbbb bb (bb) bbbb/bb bbbbbbb bbb bbbbbbbb Reports/Service Reports 2015/2015 Sample Doc Five.docx',flags=1)This is a url for a POST that is 298 characters long (and FAILS) (261 char excluding the tenant)
https://bbbbbbbbbbbbbb.sharepoint.com/sites/customer/plan/_api/web/lists/getbyid('34b6672e-531e-443e-86a8-eeb17eb9259f')/items(172)/file/moveto(newurl='/sites/customer/plan/151/bbb bbbbb bbbbbbb bb (bb) bbbb/bb bbbbbbb bbb bbbbbbbb Reports/Service Reports 2015/201501 Sample Doc Five.docx',flags=1)
There is no way at all to perform this file move using REST?
Hi Brent
You can put the newUrl variable in a Dictionary.
The assign the Dictionary as the parmeters of the Call HTTP web service action.
The POST method will include it as payload.
then Build {...} Dictionary (Output to Variable: parameters)
The pass the Dictionary to the Call HTTP web Service action...
The Call [My Site/MyList/MyItem etc.]/file/MoveTo() HTTP web service with Variable:parameters (Response Content to.....
Hope this helps,
Tony
- John Paul MensahSep 19, 2018Copper Contributor
Hi, I know its been a while but could you elaborate a little more on the resolution. I have run into the same issue using SharePoint 2013 designer workflow. A screen shot would help.
Thanks
- Sohail ZafarOct 31, 2017Copper ContributorPerfect. Tony Hignett's solution works for files with Large names.