1

Users exist in sharepoint group: enter image description here

If I do simple GET request in browser: https://mycompany.sharepoint.com/sites/testsite2/_api/web/sitegroups/getbytitle('TestGroup')/users/getbyemail('john.theuser@mycompany.com')

Returns error: "Cannot find resource for the request getbytitle." enter image description here

1 Answer 1

2

Your request should be using GetByName instead of GetByTitle

So your request should be: https://mycompany.sharepoint.com/sites/testsite2/_api/web/sitegroups/getbyname('TestGroup')/users/getbyemail('john.theuser@mycompany.com')

Reference: https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn531432%28v%3doffice.15%29

8
  • Wow. Thanks. Don't know where I got hold of GetByTitle
    – akg1421
    Mar 24, 2020 at 14:30
  • My code: pastebin.com/ZAJyCxVS I was making api call to remove user from SP group on delete button onclick. It was working fine but i changed getbytitle to getbyname and strangely click function has stopped working. Debugger doesn't work now inside onclick List view: imgur.com/z3m1h9O
    – akg1421
    Mar 24, 2020 at 20:53
  • I think this one warrants a question of its own, how is the code injected? Mar 25, 2020 at 5:40
  • Code injected inside AllItems.aspx page via SP Designer... under <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> tag. Works fine and stops under anything inside $(document).ready but click never gets triggered
    – akg1421
    Mar 25, 2020 at 8:20
  • 1
    SharePoint Framework! Mar 25, 2020 at 11:30

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.