Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I made a bug report here https://drupal.org/node/2159483 for using query parameters in the url.
Is there someone who can tell me how a logged in user can get his user details or the uid of this user?
When I have the uid I can do the following:
http://example.com/user/4.json
Thanks!
Comments
Comment #1
Grayside CreditAttribution: Grayside commentedAre you asking how they can get it via the API or via Drupal?
Within the Drupal site, look for any links to edit the user account.
In the API generated, this is a gap. I think there needs to be a RestWS DX module that adds some of the middle bits like this, like a resource that redirects to the currently logged in user account.
Comment #2
timlie CreditAttribution: timlie commentedI indeed want to get this through the restws api.
Comment #3
Alessandro Siletto CreditAttribution: Alessandro Siletto commentedFollowing.
The /user.json endpoint is available only to administrator and get the list of all users.
I need some "whoami" function that given the session auth print the user details (I need the user id).
For now I wrote my own module with this extension