Class

Users

Users(client)

Class corresponding to Aworks Users Endpoints
Constructor

# new Users(client)

Endpoint constructor
Parameters:
Name Type Description
client Client
See:
  • [Users in Awork API Docs](https://openapi.awork.com/#/Users)

View Source endpoints/Users.js, line 17

Classes

Users

Methods

# async activate(userId) → {Promise.<void>}

Activates the user with the specified id. The user is then allowed to sign in again and will be notified via email.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 125

Promise.<void>

# contactInfo(userId) → {UserContactInfos}

Returns the UserContactInfos Endpoint with the specified project Id.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 165

# async create(userCreateModel) → {Promise.<User>}

Creates a new user. The user's key is assigned automatically and can be changed later.
Parameters:
Name Type Description
userCreateModel UserCreateModel The model to create a user.

View Source endpoints/Users.js, line 70

Promise.<User>

# async deactivate(userId) → {Promise.<void>}

Deactivates the user with the specified id. A deactivated user can no longer sign in. It is only possible if the user is not the last admin user.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 116

Promise.<void>

# async delete(userId) → {Promise.<void>}

Deletes the user with the specified id.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 105

Promise.<void>

# entityTags(userId)

Returns the EntityTags Endpoint with the specified user Id and name.
Parameters:
Name Type Description
userId String The id of the users.
Deprecated:
  • Yes

View Source endpoints/Users.js, line 237

# async get(userId) → {Promise.<User>}

Returns the user with the specified id.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 34

Promise.<User>

# images(usersId) → {EntityImages}

Returns the EntityImages Endpoint with the specified user Id.
Parameters:
Name Type Description
usersId String The id of the user.

View Source endpoints/Users.js, line 191

EntityImages

# async isKeyValid() → {Promise.<String>}

Checks whether the specified user key is valid and unique.

View Source endpoints/Users.js, line 145

Promise.<String>

# async lastTimeEntries(userId) → {Promise.<TimeEntry>}

The last time entry is always the last one that was started. Time entries which are started in the future are ignored. If a time entry does not have a start time, 12.00 am is automatically assumed as the start time for comparison with other time entries from the same day.
Parameters:
Name Type Description
userId String The id of the user. Only if /users, not /me.

View Source endpoints/Users.js, line 174

Promise.<TimeEntry>

# async list(optionsopt, showArchivedopt) → {Promise.<Array.<User>>}

Returns all users with their details like status, contact info and more. Returns all users if the user has read permissions on the feature user-master-data, otherwise returns only his own user. Archived users are excluded by default. You can include them by setting the 'showArchived' query parameter. If the permissions have UserTeamsData Feature, the filter for teams is applied. Beware that this will also include API users in the response.
Parameters:
Name Type Attributes Default Description
options ListOptions <optional>
Pagination and filtering options
showArchived Boolean <optional>
false Include archived users in the results. Not required. False by default.

View Source endpoints/Users.js, line 46

Promise.<Array.<User>>

# async setArchived(userId, isArchived)

Archives or unarchives the user with the specified id. Archived objects can not be used any longer but still exist for being referenced by other entities.
Parameters:
Name Type Description
userId String The id of the user which will be changed.
isArchived Boolean Flags the entity as archived.

View Source endpoints/Users.js, line 135

# async setkey(userId) → {Promise.<String>}

Sets the user key of the user with the specified id.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 155

Promise.<String>

# tags(userId)

Returns the EntityTags Endpoint with the specified user Id and name.
Parameters:
Name Type Description
userId String The id of the users.

View Source endpoints/Users.js, line 227

# timeTrackings(userId) → {TimeTrackings}

Returns the TimeTrackings Endpoint with the specified user Id.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 218

# async update(userId, userUpdateModel) → {Promise.<User>}

Updates the user with the specified id.
Parameters:
Name Type Description
userId String The id of the user.
userUpdateModel UserUpdateModel The model to update a user.

View Source endpoints/Users.js, line 94

Promise.<User>

# userOtherPrivateTasksSubtasks(userId) → {UserOtherPrivateTasksSubtasks}

Returns the UserOtherPrivateTasksSubtasks Endpoint with the specified user Id.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 209

# userPrivateTasksSubtasks(userId) → {UserPrivateTasksSubtasks}

Returns the UserPrivateTasksSubtasks Endpoint with the specified user Id.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/Users.js, line 200