I am writing a custom widget for submitting tickets. The user authenticates with my page using email and password. At the backend, when submitting a ticket thru my widget, the users account is located via their email address and a ticket is created with them as the reporter. If the user does not already exist, they are invited. Problem is I cannot find a reliable way to look up a user by their email address. So far, I have found 2 methods:
1 `rest/api/3/user/search?query='example@example.com'`
This mostly works. All I have to do is find the result with the matching email address. Only problem is, if the user has their email address hidden, they will not be in the results.
2: `rest/api/3/groupuserpicker?query='example@example.com'`
Same problem as the last one - does not return any users with email hidden (even as a site admin). This one doesn't return email addresses at all anyway so it'd be impossible to find the matching result anyway.
This creates an issue where the widget cannot find the user, so it goes to create one instead. It cant create a user either, because one already exists under that email. How can I get a user by email address as a site admin via the rest API?