Forum Discussion
Unable to update InformationRightsManagement using REST (sharepoint-online)
- Feb 26, 2019
I'm sorry InformationRightsManagementSettings attribute is Read Only from REST API, while IrmEnabled is Read and Write.
Try to make a post directly to this endpoint /<site>/_api/web/lists(listid)/InformationRightsManagementSettings/allowPrint ( https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj247181%28v%3doffice.15%29 ) it seems to be supported :)
Cheers,
Federico
I'm sorry InformationRightsManagementSettings attribute is Read Only from REST API, while IrmEnabled is Read and Write.
Try to make a post directly to this endpoint /<site>/_api/web/lists(listid)/InformationRightsManagementSettings/allowPrint ( https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj247181%28v%3doffice.15%29 ) it seems to be supported :)
Cheers,
Federico
- viktorjonssonMar 01, 2019Copper Contributor
May I ask what json payload you're sending when you post directly to .../AllowPrint?
I'm trying the following and get status code 200 back but the boolean value does not change.
await MakeJsonRequestAsync( new { AllowPrint = true }, "/_api/web/lists('" +listId+ "')/InformationRightsManagementSettings/allowPrint", newSiteUrl, accessToken, HttpMethod.Post, headers: new Dictionary() { } );- Mar 01, 2019
- viktorjonssonMar 01, 2019Copper Contributor
Yes, I'm doing a GET and can then see that the boolean flag has not changed.
var path = "/_api/web/lists('" + listId + "')/InformationRightsManagementSettings/AllowPrint";
HttpResponseMessage response = await MakeJsonRequestAsync( new { AllowPrint = true }, path, newSiteUrl, accessToken, HttpMethod.Post, headers: new Dictionary<string, string>() {} ); response.EnsureSuccessStatusCode(); var allowPrintResp = await MakeGetRequestAsync(path, newSiteUrl, accessToken); var allowPrint = await allowPrintResp.Content.ReadAsStringAsync(); // allowPrint == {"d":{"AllowPrint":false}}