3

In the CSOM documentation on MSDN (http://msdn.microsoft.com/en-us/library/jj246523.aspx) it looks like the SP.GroupCollection.add method has a REST endpoint: http://<sitecollection>/<site>/_api/web/sitegroups/add(parameters).

When I try to Access this uri I get page not found so I guess it has not been implemented?

Does anyone know if it is possible to create new groups and assign permissions to them using the REST api? I know I can do this with CSOM, but I'm trying to get this to work from a workflow. :-)

4

To add a group via the REST API you need to send a JSON string as a body of a POST request to:

http://<server>/<site>/_api/Web/SiteGroups

The format that the endpoint expects is the following:

{
    "__metadata": {
        "type": "SP.Group"
    },
    "Title": <name>,
    "Description": <description>
}

This will return the information of the newly created group or the error if one occurs.

| improve this answer | |
  • All of them follow this pattern: __metadata object with the type and other information. But one can't just guess what is needed: so is there some source where you found this documented? Thanks! – Mzn Jan 2 '14 at 8:35
  • The fields in the corresponding CSOM object provides useful hints! (to help answer my own question). – Mzn Jan 2 '14 at 9:08
0

This page has a wealth of information, but still lacks a really simple example. (It's like they expect everyone to be a heads down keyboard jockey that can read all the mumbo jumbo.)

https://msdn.microsoft.com/en-us/library/dn531432.aspx#bk_GroupCollection

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.