Forum Discussion

ryanplant-au's avatar
9 years ago

Using the /users/email endpoint when the user has hidden their email address?

I'm interested in using the /users/email/[email] endpoint to access user information (specifically their login or ID) based on their email address.

 

This works if the user has selected "Show email address to all" in My Settings -> Preferences -> Privacy, but it doesn't work if they've selected "Show email address to no one." This makes sense, especially in the context of unauthenticated public API calls. But is there a way I can override that, and see their email address anyway, if I can authenticate as an Admin? Is there another endpoint I should be using in this case?

1 Reply

  • ryanplant-au - Make the API call using restadmin. Using only rest will respect all the permissions but restadmin will override everything.

     

    restadminMakes an arbitrary local REST call, given a REST URL, as if the calling user were an Admin with full permissions. Returns a wrapped response portion of the REST XML reply if the REST call was successful. If the call was not successful, throws a TemplateModelException.