-
Notifications
You must be signed in to change notification settings - Fork 3
Users API
The Users API provides access to the User Management functionality of TeamHaven.
- Get an existing user
- Create a new user
- Delete an existing user
- Update an existing user
- User search
- Find users closest to the specified position
GET /api/users/:u[?schema=true]
Gets the specified user. If schema=true is present, then the User's Attribute Schema is included in the response.
PUT /api/users/:u
Updates the specified User. The updated version of the User is returned in the response body.
POST /api/users
Creates a new User. The newly created User is returned in the response body. Note: Currently only Collectors can be created using this method.
DELETE /api/users/:u
Deletes a User.
GET /api/users
Returns an array of Users that match the specified search criteria.
Only return Users whose Username matches the specified value. * can be used as a wildcard.
Only return Users whose DisplayName matches the specified value. * can be used as a wildcard.
Only return Users with the specified Role.
Only return Users whose 'Name' Attribute matches the specified value. * can be used as a wildcard. Eg: UserAttribute.Email=richard@teamhaven.com
Only return Users with the specified Role or a higher one.
Only return Users with the specified Role or a lower one.
Only return Users who can collect Calls.
Only return Users who have been granted access to the specified Project. Collectors have access if they have been assigned to any Calls or Targets. Project Managers, Field Managers and Clients must be explicitly given access.
Note: Administrators are not returned in this list, because they always have access to every project.
Role values are:
1 - Administrator
2 - Collector
3 - Project Manager
4 - Client
5 - Field Manager
GET /api/users/closest?position=:latlng&radius:r[&incumbent=:u]
Returns an array of up to 5 Collectors who are the closest to the specified position.
The latitude and longitude centre of the search area. Must be specified as a pair of floating point numbers using ',' as a separator and '.' as the decimal point. Eg: 12.4323,-23.213.
The search radius, specified in miles.
The UserID of a User who should always be included in the list of results, even if they do not meet the search criteria.