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.
Should have clarified, this is when pulling from a page of nodes. The nodes show the details of the node ( with uid as a field ), but how do I get the user information to be returned as well? ( like username, email, etc ).
Thanks,
Mike
Comments
Comment #2
admin@beerbaitandfishing.com CreditAttribution: admin@beerbaitandfishing.com as a volunteer commentedComment #3
Wim LeersYou're getting the ID of the user. Based on that, you can perform a second request to retrieve the data for the user.
When you're using the
hal_json
format, there is a link (under_links
) already pointing to that user, you can just follow that URL.The core REST module does not support embedding referenced entities in the main response. If you want that, I suggest you give https://www.drupal.org/project/jsonapi a try!
Comment #4
admin@beerbaitandfishing.com CreditAttribution: admin@beerbaitandfishing.com as a volunteer commentedThanks for the response. Is there somehwere that I can change the sql to include this information in the restui module? I'd like to use restui ( already built a bunch of services that use it ) and just need this additional info.
Thanks,
Mike
Comment #5
Wim LeersIt's more than a matter of changing SQL. If you modify the code, you won't be able to update easily in the future. Why not just make a second request?
Comment #6
clemens.tolboom