Andrew Fletcher published: 16 May 2022 1 minute read
The user parameters provides details about a specific user based on the following parameters:
- User uid;
The output of this query will return user profile data only of the fields containing data. An example of the data returned includes, but is not limited to the following:
- Name {name} - in the system this is their username;
- Created {created}
- Firstname {field_firstname}
- Lastname {field_lastname}
- Gender {field_gender}
Calling a query
To call a user query the details are required:
- User uid;
- Authentication credentials
The query string is: domain/user/uid?_format=hal_json
See the notes on set up, for the staging and production URLs. Using the current staging URL in the set up screen, as example of the query string using the following criteria
- uid = 32
https://your-site.com/user/32?_format=hal_json
Example of the json output
{
"_links": {
"self": {
"href": "http://your-site.com/user/32?_format=hal_json"
},
"type": {
"href": "http://your-site.com/rest/type/user/user"
}
},
"uid": [
{
"value": "32"
}
],
"uuid": [
{
"value": "f000c9a3-82b2-4ef7-92bb-786f00863c66"
}
],
"langcode": [
{
"value": "en",
"lang": "en"
}
],
"name": [
{
"value": "malcom"
}
],
"created": [
{
"value": "1467304565"
}
],
"changed": [
{
"value": "1475776333",
"lang": "en"
}
],
"default_langcode": [
{
"value": "1",
"lang": "en"
}
],
"field_firstname": [
{
"value": "Ron"
}
],
"field_gender": [
{
"value": "male"
}
]
}
Related articles
Andrew Fletcher
•
09 Jan 2026
Upgrading Drupal from 10.6.x to 11.3.2: a practical, dependency-driven walkthrough
Upgrading from Drupal 10.6.x to 11.3.x is officially supported, but in real projects it’s rarely a single command. The friction usually comes from **Composer constraints**, not Drupal itself.This article documents a real-world upgrade path from Drupal 10.6.1 → 11.3.2, including the specific blockers...
Andrew Fletcher
•
04 Apr 2025
Managing .gitignore changes
When working with Git, the .gitignore file plays a critical role in controlling which files and folders are tracked by version control. Yet, many developers are unsure when changes to .gitignore take effect and how to manage files that are already being tracked. This uncertainty can lead to...
Andrew Fletcher
•
26 Mar 2025
How to fix the ‘Undefined function t’ error in Drupal 10 or 11 code
Upgrading to Drupal 10.4+ you might have noticed a warning in their code editor stating “Undefined function ‘t’”. While Drupal’s `t()` function remains valid in procedural code, some language analysis tools — such as Intelephense — do not automatically recognise Drupal’s global functions. This...