Users
findUsers
Query for users
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
LoginName | String | Search string for a user's login name |
AuthServer | String | Signature of the authentication server, as given by getAuthServers |
Name | String | Search string for the user's name |
String | Search string for the user's email | |
UsersAllowedToLoginOnly | Boolean | Flag to indicate whether to include all users, or only users that have login permissions |
SortOrder | String | The sorting order for the users matching the query |
IncludeObjectNames | Boolean | Flag to indicate whether to include object names or not on the return |
BeginIndex | Int | Index of the first user to return (for pagination) |
NumberOfUsers | Int | Maximum number of users to return (capped at 1000 per query, use BeginIndex to paginate over the users) |
Returns
Return | Type | Description |
---|---|---|
Users | User[] | Array of users matching the query |
TotalNumOfUsers | Int | Total number of users matching the query |
Example
Request
<tns:loginname>admin</tns:loginname>
<tns:authserver></tns:authserver>
<tns:name></tns:name>
<tns:email></tns:email>
<tns:usersallowedtologinonly>true</tns:usersallowedtologinonly>
<tns:sortorder></tns:sortorder>
<tns:beginindex>0</tns:beginindex>
<tns:numberofusers>100</tns:numberofusers>
getUsers
Get users by usernames and authentication servers
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Users | User[] | Array of usernames and authentication servers |
Returns
Return | Type | Description |
---|---|---|
Users | User[] | Array of the requested users |
Example
Request
<tns:users>
<user>
<loginname>admin</loginname>
<authserver>timeedit</authserver>
</user>
</tns:users>
getUserSortOrders
Get available user sort orders
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Returns
Return | Type | Description |
---|---|---|
SortOrders | String[] | Array of available sort orders for users |
Example
Request
-
getAuthServers
Get available authentication servers
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
ActiveOnly | Boolean | Flag to indicate whether to only include active authentication servers |
Returns
Return | Type | Description |
---|---|---|
AuthServers | AuthServer[] | Array of available authentication servers |
Example
Request
-
getPermissions
Get permissions for the authenticated user
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Returns
Return | Type | Description |
---|---|---|
Permissions | Permission[] | Array of permissions for the authenticated user |
Example
Request
-
validateUsers
Validate new users without importing them
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Users | User[] | Array of users to validate |
Returns
Return | Type | Description |
---|---|---|
Status | Status[] | Array of validation status per user. A status of 0 indicates the user was successfully validated |
Example
Request
<tns:users>
<user>
<loginname>kalle</loginname>
<authserver>timeedit</authserver>
<firstname>Kalle</firstname>
<lastname>Testsson</lastname>
<email>[email protected]</email>
<phone>031-123456</phone>
<changepassword>true</changepassword>
<language/>
<dateformat/>
<timezone/>
<dst/>
<allowlogin>true</allowlogin>
<standardorganization>timeedit;admin</standardorganization>
<orgroles>
<orgrole>timeedit=Admin</orgrole>
</orgroles>
<permissions>
<permission>client</permission>
<permission>periods</permission>
</permissions>
<organizations>
<organization>timeedit;admin</organization>
</organizations>
</user>
</tns:users>
importUsers
Import users
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Users | User[] | Array of users to import |
Returns
Return | Type | Description |
---|---|---|
Status | Status[] | Array of import status per user. A status of 0 indicates the user was successfully imported |
Example
Request
<tns:users>
<user>
<loginname>anders</loginname>
<authserver>timeedit</authserver>
<firstname>Anders</firstname>
<lastname>Svensson</lastname>
<email>[email protected]</email>
<phone/>
<changepassword>false</changepassword>
<language/>
<dateformat/>
<timezone/>
<dst/>
<allowlogin>true</allowlogin>
<defaultobjects>a467949c-1ced-46f6-b4ba-289a5ee709c6</defaultobjects>
<standardorganization>all_teachers</standardorganization>
<orgroles>
<orgrole>oAdmin=scheduler</orgrole>
</orgroles>
<permissions>
<permission>client</permission>
</permissions>
<organizations>
<organization>all_teachers</organization>
</organizations>
<description/>
</user>
</tns:users>
exportUsers
Export users
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Users | User[] | Array of usernames and authentication servers to export |
Returns
Return | Type | Description |
---|---|---|
Users | User[] | Array of users requested |
Example
Request
<tns:users>
<user>
<loginname>anders</loginname>
<authserver>timeedit</authserver>
</user>
</tns:users>
deleteUsers
Delete users
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Users | User[] | Array of users (usernames and authentication servers) to delete |
Inactivate | Boolean | Flag to indicate whether the user should be inactivated if it couldn't be deleted |
Returns
Return | Type | Description |
---|---|---|
Status | Status[] | Array of statuses for the deletion request |
Example
Request
<tns:users>
<user>
<loginname>anders</loginname>
<authserver>timeedit</authserver>
</user>
</tns:users>
<tns:inactivate>false</tns:inactivate>
getCurrentUserObjects
Get objects associated with the authenticated user
Parameters
Parameter | Type | Description |
---|---|---|
Login | LoginObject | Standard login object with username, password, and application key |
Types | Type[] | Array of types to filter user objects on |
Returns
Return | Type | Description |
---|---|---|
UserObjects | UserObjects[] | Array of objects of the specified type(s) associated with the authenticated user |
Example
Request
<tns:types>
<type>room</type>
</tns:types>