exportUserById

Export a single user by ID.

This method exports a single user by its ID.

Signature

This method has the following signature:

exportUserById(options: {userId: string}): Promise<{data: User}>

Example

Here is an example of how to use this method:

123456789101112131415
import {Configuration, ExportApi} from '@croct/export';
async function getUser(): Promise<void> {  const api = new ExportApi(    new Configuration({      apiKey: '<API KEY>'    })  );
  const {data: user} = await api.exportUserById({    userId: '6d5f1fe8-3f21-4bce-9afb-e1d11b610674',  });
  console.log(user);}

Parameters

The following list describes the supported parameters:

options
object

The request parameters.

userId
string

The ID of the user in UUID format.

Return

This method returns the following response:

userId
string

The internal ID assigned to the user, unique across the workspace, in UUID format.

externalUserId
string|null

The external user ID used to identify the user on the application side.

Always null for anonymous users.

firstName
string|null

The user’s first name.

lastName
string|null

The user’s last name.

birthDate
integer|null

The user’s birth date, in milliseconds since epoch.

gender
string

The user’s gender.

These are the possible values and what they represent:

ValueDescription
MALEMale gender.
FEMALEFemale gender.
NEUTRALNeither male nor female gender.
UNKNOWNAn unspecified gender.
email
string|null

The user’s primary email address.

alternateEmail
string|null

The user’s alternate email address.

phone
string|null

The user’s primary phone number.

alternatePhone
string|null

The user’s alternate phone number.

address
UserAddress

The user’s address information.

street
string|null

Street address.

district
string|null

District or neighborhood.

city
string|null

City name.

region
string|null

State or region.

country
string|null

Country name.

postalCode
string|null

Postal or ZIP code.

avatar
string|null

The URL of the user’s avatar image.

company
string|null

The user’s company name.

companyUrl
string|null

The user’s company website URL.

jobTitle
string|null

The user’s job title.

activities
Array<string>

The user’s activities.

interests
Array<string>

The user’s interests.

customAttributes
object

Custom attributes associated with the user.

lastModifiedTime
integer

The timestamp when the user was last modified, in milliseconds since epoch.

Not updated on sync operations.

statistics
UserStatistics

Aggregated user statistics across the workspace.

orders
integer

The total number of orders placed across all applications.

sessions
integer

The total number of sessions across all applications.

If no user matches the given ID, the method throws a resource not found error.