Closed CaramelHeaven closed 6 years ago
403 : Forbidden - was resolved. I missed some permissions. 400 : Bad Request is still alive. Even if I get the FieldValueSet object and then update it without any changes, the request will still remain bad.
FieldValueSet was resolved. The SharePoint API does not allow sending older fields, such as @ odata.etag or modified, because it updates them yourself. We can create a simple object and add some fields like this:
FieldValueSet fieldValueSet = new FieldValueSet();
fieldValueSet.getAdditionalDataManager().put("comment", primitive);
After it, we just send this object in patch:
graphClient.getSites(SITE).getLists(idParentList).getItems().byId("7").getFields()
.buildRequest().patch(fieldValueSet);
But when I run it, I catch an exception:
I checked the link to the working state above (after PATCH, where what I want to change) in this and successfully changed the fields. What is the problem?
Exception below. Also I checked and this link in Graph Explorer and deleted some items successfully.