Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Unable to change UniqueContentTypeOrder of folder via REST API

$
0
0

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




Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>