User
List users
Get a list of users.
const response = await geocore.User.listUser({
groupIds: ["groupId"],
name: "name",
username: "username",
email: "email",
serialNumber: "serialNumber",
accessLevels: ["user"],
lastLoginRange: {
start: "2025-01-01",
end: "2025-01-01",
}
createdRange: {
start: "2025-01-01",
end: "2025-01-01",
}
updatedRange: {
start: "2025-01-01",
end: "2025-01-01",
}
lastLocation: {
north: 1,
south: 2,
west: 3,
east: 4,
};
page: 1,
limit: 10,
});
Parameters
name type data type description groupIds optional array<string> Search by group IDs username optional string Search by username name optional string Search by full name optional string Search by email serialNumber optional string Search by serialNumber accessLevels optional array<string> Search by user access level lastLoginRange[start] optional date Search by lastLoginTimetimestamplastLoginRange[end] optional date Search by lastLoginTimetimestampcreatedRange[start] optional date Search by createdAttimestampcreatedRange[end] optional date Search by createdAttimestampupdatedRange[start] optional date Search by modifiedAttimestampupdatedRange[end] optional date Search by modifiedAttimestamplastLocation[north] required number Longitude of north west point lastLocation[south] required number Latitude of north west point lastLocation[west] required number Longitude of north east point lastLocation[east] required number Latitude of north east point page optional number Page ordinal number limit optional number Number of records per page
Response note
The final result depends on logged in user's access level
- Users can find other users in the same subgroups.
- Group admins can find users in their subgroups.
- Company admins can find users in their company groups.
- Super admins can find any users.
Create user
Create a new user.
const response = await geocore.User.createUser({
username: "exampleUser",
password: "BVT2FMhbaaXGwPoC3SRoJipqBsiqo127FbbMMf5@69d3!9d1V@?T8*6PDSXw",
email: "user@example.com",
name: "string",
accessLevel: "string"
});
Prerequisites
Successfully get the IdToken with superAdmin access level from login API.
Parameters
name type data type description username required string Username password required string Password required string name required string Full name accessLevel required string User access level
Update user
Update a new user.
const response = await geocore.User.update(userId, {
serialNumber: "123456789",
name: "string",
});
Prerequisites
Successfully get the IdToken with superAdmin or user access level from login API.
Parameters
name type data type description userId required string User ID name required string Full name serialNumber required string User serial number
Update user password
Update a new user password.
const response = await geocore.User.updatePassword(userId, {
oldPassword: "string",
newPassword: "string",
});
Prerequisites
Successfully get the IdToken with superAdmin or user access level from login API.
Parameters
name type data type description userId required string User ID oldPassword required string Old password newPassword required string New password
Import users
Import users from a CSV file.
const formData = new FormData();
formData.append('groupId', groupId);
formData.append('csv', csvFile);
const response = await geocore.User.uploadUsers(formData);
Prerequisites
Successfully get the IdToken with superAdmin access level from login API.
Parameters
name type data type description groupId required string Group ID to import users into csv required string CSV file with user information
Export users
Update user last location
Update last location of logged in user.
const response = await geocore.User.updateLastLocation({
coordinates: [12, 34]
});
Parameters
name type data type description coordinates required array<number> Location of user