I'm trying to create a sub site using the web request action as the 365 create site action is not available in our action pack. I have the web request action configured to:
URL call: <site url>/_api/web/webinfos/add
Method: POST
Content-type: application/json;odata=verbose
Accept: application/json;odata=verbose
Origin: 0
Body (Content): {"parameters": {"__metadata": {"type": "SP.WebInfoCreationInformation"},"Url": "choc","Title":"Chocolate","Description": "Example","Language": 1033,"WebTemplate": "PROJECTSITE#0","UseUniquePermissions": true}}
Instead of getting the request digest, I have provided the user name and password of a SharePoint admin, so an authenticated header will be created regardless of who triggers the workflow. The response code I'm getting is:
{"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."}}}
Does anyone have any ideas on how to resolve this issue? Is there something hugely obvious I'm missing?
Any help greatly appreciated.