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
•
18 Mar 2024
Notice: Only variables should be passed by reference in load_view_block_content()
Working through the following errorNotice: Only variables should be passed by reference in load_view_block_content() (line 391 of /var/www/vhosts/{domain}/httpdocs/themes/custom/{theme}/{theme}.theme.theme)If you want to read the full error, scroll to the bottom in Appendix. The related...
Andrew Fletcher
•
15 Mar 2024
Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value "f" contains a non-scalar value
Using Drupal 10, VIews, Solr and Facets has post upgrade to version 10, created the following issueSymfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value "f" contains a non-scalar value. in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of...
Andrew Fletcher
•
15 Mar 2024
Could not apply patch! Skipping
Attempting to apply a patch in Drupal 10.2.4 that had been working until this version. Now I'm seeing the following errorCould not apply patch! Skipping. The error was: The process "patch '-p1' --no-backup-if-mismatch -d '/Users/andrewfletcher/Sites/codebales/modules/contrib/facets' <...