I am trying to manage web properties from property bag using REST API.

It is pretty straightforward how to get the values

var url = "https://site.sharepoint.com/_api/web/allProperties";
    url: url,
    method: "GET",
    dataType: "json",
    headers: { "Accept": "application/json; odata=verbose" },
    success: successHandler,
    error: errorHandler

However, I am unable to set the specific property. Any ideas how to achieve that?

What I have found at MSDN, the AllProperties is available only for read in REST

  • I also could not find any example using REST api to set property bag. If JSOM is an option, you can try that to set the property bag value. omicron-llama.co.uk/2011/10/03/… – Nadeem Yousuf Mar 3 '15 at 8:29
  • Unfortunately, I need to use Script Editor Web Part so afaik client context will not be available. Or am I wrong? – luccio Mar 3 '15 at 8:44
  • Client context will be available. Wrap the call in SP.SOD.executeFunc. Do you want me to share the code with you? – Nadeem Yousuf Mar 3 '15 at 8:48
  • 1
    Ah, you are right. Thanks for pointing this out! However, still curious about the REST approach. – luccio Mar 3 '15 at 8:50
  • 1
    I am also curious. If there is any way of doing it, I am sure @Vadim will have the answer. He may be crafting one for you right now. sharepoint.stackexchange.com/users/10610/vadim-gremyachev – Nadeem Yousuf Mar 3 '15 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.