The user zeroarst is asking how to retrieve user details using a user API key, as they only have the key and not the user ID or name. david suggests using the /session/current.json endpoint with the session scope, which works for zeroarst. riking mentions that /my/profile.json could also work if the appropriate scopes are granted, but zeroarst reports it returns a page not found error. zeroarst confirms that david’s solution works, though they prefer not needing the session scope.
But I also want to get the user info, because the authentication is done on the web page above, I don’t know the user name or id. They are not returned from the callback URL.
I am wondering if there is an api for me to pass back the user api key and returns the user details? I just need the user id or user name.
You should be able to make a request for /session/current.json, which will give you the current user information. Make sure you request the session scope when creating the key.
I cannot get it working. I got page does not exist response. I put the user api key in the header User-Api-Key. David Taylor’s solution works for me. But it will be good yours is working as well as I don’t need to request session scope.