Delete Site Group, Role Definition and Get the Permission Level Properties in SharePoint 2013

Updated: Mar 18, 2019

Introduction

SharePoint 2013 introduces a Representational State Transfer (REST) service that is comparable to the existing SharePoint client object models. This allows the developers to interact remotely with SharePoint data using any technology that supports REST web requests. This means that developers can perform Create, Read, Update and Delete (CRUD) operations from their apps for SharePoint, solutions and client applications, using REST web technologies and standard Open Data Protocol (OData) syntax. In this article you will see the following:

  1. Create an app using the NAPA Tool in SharePoint 2013 Online.

  2. Cross-Domain Requests.

  3. Delete a site group using the REST API.

  4. Delete a role definition using the REST API.

  5. Get the permission level properties using the REST API.


Endpoint URI

https://c986.sharepoint.com/_api/web/sitegroups/removebyloginname(‘groupname)

Note: If you are making cross-domain requests then you need to add SP.AppContextSite(@target) and ?@target='<host web url>' to the endpoint URI.

HTTP Method: POST

Properties

The following properties must be used in the REST request for deleting the role definition:

  1. IF-MATCH header: It is required in POST requests for a DELETE operation. Description: Provides a way to verify that the object being changed has not been changed since it was last retrieved. Or, lets you specify to overwrite any changes, as shown in the following example: "IF-MATCH":"*".

  2. X-HTTP-Method header: It is required in POST requests for DELETE operations. Description: Used to specify that the request performs a delete operation. Example: "X-HTTP-Method":"DELETE".Use the following to get the permission level properties.

HTTP Method: GET: Read a Resource JSON:


Create an app using the NAPA Tool

  • Navigate to the SharePoint 2013 Online site.

  • Click on Site Contents in the quick launch bar.

  • Click on “Napa” Office 365 Development Tools.


  • Click on Add New Project.