I have problem with REST Query that should update field in project. I am sending the following Query:
var projectItem = { "projectId": "21dba5cc-43e9-e611-80e2-02bf0a010149", "propertyId": '22301607-98b8-e611-80e6-02bf0a010149', "value": "Some example Action field value." }; var projectUpdated = false; jQuery.ajax({ url: _spPageContextInfo.siteAbsoluteUrl + '/_api/ProjectServer/WorkflowActivities/updateTextProperty', type: 'POST', contentType: 'application/json;odata=verbose', data: JSON.stringify(projectItem), headers: { "Accept": 'application/json;odata=verbose', "X-RequestDigest": jQuery('#__REQUESTDIGEST').val() }, success: function(data) { console.log("jQuery ajax was finished successfully with the following prop: "); console.log(" Project id: " + projectItem.projectId + ","); console.log(" Field id: " + projectItem.value); console.log(" Field value: " + projectItem.value); }, error: function(data) { console.log("jQuery ajax was finished unsuccessfully with the following error:"); console.log(" data.status: " + data.status); console.log(" data.statusText: " + data.statusText); console.log(" data.responseText: " + data.responseText); } });
And I get the following error:
jQuery ajax was finished unsuccessfully with ther following error: data.status: 403 data.statusText: FORBIDDEN data.responseText: {"error":{"code":"-2130575252, 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."}}}