Forum Discussion
Brent Ellis
Jul 20, 2017Silver Contributor
Calling _api/search/postquery from Modern Web Part (security validation invalid)
I am trying to call /_api/_search/postquery from a modern Script Editor web part, and I am getting this error: VM6497:86 {"error":{"code":"-2130575251, Microsoft.SharePoint.SPException","message"...
- Jul 20, 2017
I've found that if I make POSTs from a different site (or site collection) than the REST URL target, my on page RequestDigest won't do. I need to grab a fresh one from the target site _api/contextinfo.
Not sure if this is your issue, but worth a try.
Richard Bourke
Jul 20, 2017Iron Contributor
I've found that if I make POSTs from a different site (or site collection) than the REST URL target, my on page RequestDigest won't do. I need to grab a fresh one from the target site _api/contextinfo.
Not sure if this is your issue, but worth a try.
- Brent EllisJul 20, 2017Silver ContributorAttempting that currently with no luck :(
The RequestDigest from the _api/contextinfo and the POST are on the same site, and I get the same error.