I have been through metabase REST API. For retrieving a User we have to use below API:
where ‘id’ is metabase generated numeric unique Id.
Is there any API where we can retrieve user by EmailId/UserId
Any reason you can’t just use GET /api/user/ to get a list of all users?
I want to check if particular email Id is already registered on metabase.
Retrieving the list of all the users each time to check that doesn’t seem a good option.
To avoid retrieving of the data each time:
I will have to maintain a copy of all Users(which I will have to keep updating).
I can query directly to metabase metadb (I am using PostgreSQL as external DB) table ‘core_user’.
(I am not sure if interacting directly with metabase meta db is a good idea.)
So if we have an API like GET /api/user/:username. It would be helpful. Definitely, will save a lot of work.
I can see that as a problem if you have 1000s of users, but other than that, just write a helper class.
Querying the metadb is fine provided the database doesn’t change across versions. I’m not sure of the page size, but I’d expect all your users to fit in one page, so still pulling everything from the DB each time.
Alright. I have no constraints on number of users. So I would go with querying the metadb.