Retrieving a User (bizzStream.getUser)
You can use bizzStream.getUser
to retrieve information about an existing user in the system based on various identifying criteria.
Syntax
bizzStream.getUser(options);
Parameters
The getUser
function takes a single 'options' object with the following properties. You should provide at least one of these properties to identify the user.
Parameter | Type | Required | Description |
---|---|---|---|
_id | String | No | The unique identifier (ID) of the user. |
username | String | No | The username of the user. |
globalEmailAddress | String | No | The global e-mail address of the user. |
name | String | No | The name associated with the user (e.g., display name). |
String | No | The e-mail address of the user. |
Return value
Returns an object containing the user's details if a user is found that matches the criteria. If no user is found, it returns undefined. The exact structure of the returned user object is similar to the object returned by bizzStream.addUser.
{
"_id": "1YNEXKYkPnqk52Fzf",
"_createdOn": "2019-02-12T14:06:35.062Z",
"_createdByUserId": "system",
"_lastModifiedOn": "2025-04-18T08:00:37.120Z",
"_lastModifiedByUserId": null,
"username": "admin",
"authentication": {
"password": "token",
"logins": [ "Array" ]
},
"globalEmails": [ { "address": "admin@maxedy.com", "verified": true } ],
"partnerId": "VanMeijel",
"isBizzStreamSupport": true,
"profile": {
"environments": {
"maxedy_pizza": ["Object"]
},
"globalDisableCache": true
},
"lastLogin": "2025-04-04T07:26:16.090Z"
}
Examples
Example get user by ID
The following example shows how to retrieve a user by their unique ID:
bizzStream.getUser({ _id: 'user123' });
Example get user by global e-mail address
This example retrieves a user by their global email address:
bizzStream.getUser({ globalEmailAddress: 'user@example.com' });