How to get user api_key based on user_id?


(Mudedla Panduranga Rao ) #1

I can see that admin can create api_key for individual user. I want to get api_key for a particular user. How can i do that. Some one please help me to resolve this.

Thanks


(Simon Cossar) #2

If the user has an api_key, it will be returned when you make an authenticated GET request to /admin/users/:user_id.json.


(Mudedla Panduranga Rao ) #3

Thanks for your support. This solution working fine. Is there any way to get api_key by sending api call to users/list/active.json end point?


(Mittineague) #4

Maybe try

/admin/api/keys.json

IMHO asking for only the information you’re interested in would be more efficient

Well, it also has the avatar_template that you won’t likely be interested in. But still.


(Mudedla Panduranga Rao ) #5

@Mittineague I tried /admin/api/keys.json and i’m getting api keys. But it hard to iterate through entire list to get particular user api_key.