How to get location_info (country name) in Auth0 User logs using management api?

289 views Asked by At

I am using c# app and fetching user logs from auth0 management api v2 using "/api/v2/logs?q=". The logs contains lot of information but I can't find country name(from where the user login) in the logs. I can see location_info property in official docs https://auth0.com/docs/api/management/v2#!/Logs/get_logs but I am not sure how to use it. Do I need to send any query param like "q=location_info=true" something like this or is there any other way?

1

There are 1 answers

0
Ask On

Ok, so I found the answer. Actually it was a silly mistake that was blocking location_info in the response. I was calling this url "/api/v2/logs?q=userId:{user_id}" which returns dashboard logs. Instead I needed only user logs that can be seen in user's profile in Auth0. For that I needed to hit this url "/api/v2/users/{user_id}/logs". Once I hit this url I got location_info (country name, country code, city name etc) object in response.