Hello!
I have an issue. With REST API I create a site, add new groups to this site and add users to the group. I need to grant some permissions to the new groups. I've tried to do so by binding role to the group:
.../_api/web/roleassignments/addroleassignment(principalid=NEW_GROUP_ID, roledefid=ROLE_ID)
It works fine with groups which are already present on the site, but for new group it returns an error:
BadRequest
code -214702480
Value does not fall within the expected range.
Trying to fix this I noticed that new groups are absent from the /_api/web/roleassignments/groups list.
How can I grant permissions to the new groups?