Hi there,
I'm trying to change UniqueContentTypeOrder property of folder via REST API, but i get a error shown as bellow.
Error: "-1, System.Reflection.TargetInvocationException"
Message: "Exception has been thrown by the target of an invocation."
Here is my code:
var url = "https://xxxx.sharepoint.com/sites/test/_api/web/lists/getbytitle('test')/RootFolder"; var data = {"__metadata": {"type": 'SP.Folder' },"UniqueContentTypeOrder": {"__metadata": {"type": 'Collection(SP.ContentTypeId)' },"results": { [ {"StringValue": "0x0101006A780A883713EF408594C69B0316E83E"} ] } } }; var settings = { type: 'POST', data: data, headers: { 'Accept': 'application/json;odata=verbose', 'Content-Type': 'application/json;odata=verbose', 'IF-MATCH': '*', 'X-HTTP-Method': 'MERGE' 'X-RequestDigest': $('#__REQUESTDIGEST').val() } }; return $.ajax(url, settings);
Can anyone help me on this?
Thanks,
Maku