Forum Discussion
Project OData/API
I have an integration team who has come to me and raised a concern that the code in place which was working earlier is failing now. I then checked what is being sent to query the data and found one of the metadata property sent as a filter doesnt exist in the metadata structure. Hence upon modifying their query to remove that worked. Thats the reason just wondering if anything has changed in this context.
- yaminiradhamaniJul 25, 2018Copper Contributor
Hey Ian, thanks your quick response. The input data is
{
"Id": "ResourceGUID",
"IsActive": "false",
"__metadata": {
"type": "PS.EnterpriseResource"
}
}Which is being sent to
https://xxxx.sharepoint.com/sites/pwa/_api/ProjectServer/EnterpriseResources/GetById('ResourceGUID')Which produced the error response
{
"odata.error": {
"code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
"message": {
"lang": "en-US",
"value": "A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value."
}
}
- Ian BrucknerJul 26, 2018Iron Contributor
I'm not well versed in the structure of the query you provided. I've typically queried against _api/ProjectData instead of /ProjectServer.
for example:
https://xyz.sharepoint.com/sites/pwa/_api/ProjectData/Resources?$filter=ResourceIsActive eq false and ResourceID eq 'guid'
Here's the reference
all: https://docs.microsoft.com/en-us/previous-versions/office/project-odata/jj163015(v%3doffice.15)
resource type: https://docs.microsoft.com/en-us/previous-versions/office/project-odata/jj163027(v%3doffice.15)
Valid Resource Types: https://msdn.microsoft.com/en-us/library/jj232846%28v=office.15%29?f=255&MSPPError=-2147217396
- yaminiradhamaniJul 26, 2018Copper ContributorThanks! Ian