question

sp13test-6829 avatar image
0 Votes"
sp13test-6829 asked JyothiSakre-6244 answered

The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again with valid X-RequestDigest

Calling Rest API in SharePoint Online to update some field value, but it throws this error:

 {"readyState":4,"responseText":"{\"error\":{\"code\":\"-2130575251, Microsoft.SharePoint.SPException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again.\"}}}","responseJSON":{"error":{"code":"-2130575251, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again."}}},"status":403,"statusText":"error"}


I think I have the valid X-RequestDigest:

   $.ajax({
                     url: requestUri,
                     type: "POST",
                     headers: {
                         "accept": "application/json;odata=verbose",
                         "content-type": "application/json;odata=verbose",
                         "X-RequestDigest": $("#_REQUESTDIGEST").val()
                     },
                     success: onSuccess,
                     error: onError
                 });
office-sharepoint-server-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jerryzy avatar image
1 Vote"
Jerryzy answered

Hi @sp13test-6829 ,

There is a typo in X-RequestDigest, it should be like this:

 "X-RequestDigest": $("#__REQUESTDIGEST").val()

Then please try again to see if it works.

Thanks
Best Regards



If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JyothiSakre-6244 avatar image
0 Votes"
JyothiSakre-6244 answered

Same issue with me

I'm using below code but still issue persists

X-RequestDigest": $("#__REQUESTDIGEST").val()


Any help?



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.