0

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

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

  • Wow. Thanks. Don't know where I got hold of GetByTitle – akg1421 Mar 24 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 at 20:53
  • I think this one warrants a question of its own, how is the code injected? – Rune Sperre Mar 25 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 at 8:20
  • Maybe some other event handler that overrides it? Again, you should create a new question for this to get more attention to it. I don't do much work with classic pages :-) – Rune Sperre Mar 25 at 9:05

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.