0

I have been using the SPServices UpdateListItems code below for several years on an on-premise SharePoint 2013 Enterprise server without any issue. However, we recently migrated to a new cloud-based SharePoint 2013 Enterprise server (managed by another department) and now this code is returning a 403 FORBIDDEN status. This isn't just for this one UpdateListItems call, it is for every one that I have in all of my sites. I cannot figure out what is going on and am beginning to think it is with the server configuration. I have re-written the UpdateListItems code as REST and it fails as well. The response text errorstring is not very helpful, as refreshing the browser page does not help, no matter how many times I refresh it. Any help would be greatly appreciated.

//variables req and proj are passed to the function and are validated before use. $().SPServices({ operation: "UpdateListItems", async: false, listName: "Requests", ID: req, valuepairs: [["Project",proj]], completefunc: function (xData, Status) { $(xData.responseXML).SPFilterNode("z:row").each(function() { }); } }); 

Response Text:

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring> <detail> <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.</errorstring> <errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x8102006d</errorcode> </detail> </soap:Fault> </soap:Body> </soap:Envelope> 
2
  • Does the user have permission? Commented Sep 21, 2020 at 6:31
  • Yes. I'm the site collection admin. Commented Sep 21, 2020 at 12:50

1 Answer 1

0

You could try to all unsafe update.

<script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(test, "sp.js"); function test(){ var ctx = SP.ClientContext.get_current(); var web = ctx.get_web(); web.AllowUnsafeUpdates=true; $().SPServices({ operation: "UpdateListItems", async: false, listName: "Requests", ID: req, valuepairs: [["Project",proj]], completefunc: function (xData, Status) { web.AllowUnsafeUpdates=false; $(xData.responseXML).SPFilterNode("z:row").each(function() { }); } }); } </script> 
1
  • The server admins have been making changes and it is working (for now). However they don't know what change they made that fixed it. I'm still having the server admins try and figure out the change that was made. Once I know the change, I'll post it as the answer. Commented Sep 22, 2020 at 19:37

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.