CreateUpdateUser
Creates or updates an user in Microbizz.
If a user with the given user id already exists, then the user will be overwritten.
If the user provided have a user id of 0, a new user will be created and a new user id will be provided.
user | user | The user to create/update |
Output
user | user | The user object as it is in Microbizz after the update |
AddUserToTeam
Add a user to a team, or removes a user from a team.
Can also be used to read which teams the user is member of, by not specifying leader
, member
or viewer
.
userid | number | The ID of the user |
teamid | number | The ID of the team |
leader | number | Set to 1 to mke the user team leader, 0 to remove |
member | number | Set to 1 to make the user member of the team, 0 to remove |
viewer | number | Set to 1 to make the user a team viewer, 0 to remove |
Output
teams | collection | A collection with 3 elements: leader, member, viewer which lists the teams for the user |
If leader
is not set to 0 or 1 or is not specified, then the user's team leadership will not be updated. Likewise for member
and viewer
.
SetTeamsByUserCode
Set teams by user number.
Set the users association to teams by the users usercode. Existing associations are removed.
usercode | string | The user code of the user |
leaderteams | collection | A collection of team IDs where the user is to be team leader |
memberteams | collection | A collection of team IDs where the user is to be member |
viewerteams | collection | A collection of team IDs where the user is to be viewer |
Output
SetMembersByUserCode
Set team members by user code.
Set the team different associated users, by their usercode. Existing associations are removed.
teamid | string | A team ID |
leaders | collection | A collection of user codes where each user is a team leader |
members | collection | A collection of user codes where each user is a member |
viewers | collection | A collection of user codes where each user is a viewer |
Output
GetUserByID
Get a user by their Microbizz user id
If no such user exist an empty collection will be returned.
userid | number | The microbizz user id of the user to fetch |
Output
users | collection[ user ] | A collection either empty if no user was found, or with exactly one element being the user. |
GetUsersByLastChange
Get a collection of users changed since a given date and time.
changedate | date | Return all users changed on or after the provided date. |
changetime | time | If this is provided only return users changed after the provided date and time. |
skip_deleted | bool | If 1 then don't send deleted users |
Output
users | collection[ user ] | A collection of the relevant users, or an empty collection if no users was found. |
GetTeams
Get all teams in Microbizz, and get “my” teams.
Output
teams | collection[ team ] | All teams |
myteams | collection[number] | The IDs of the teams that the current user belongs to |
GetUserTypes
Get all user types in Microbizz
Output
types | collection | types |
types.id | int | ID of type |
types.title | string | Title |
types.letter | string | Letter representation |
types.color | string | Color code |
GetWorkdayByUserID
Get the workday setup for a user
userid | number | The Microbizz ID of a user |
Output
workdays | collection[ number ] | List of workdays where the user is on work |
daystart | set | The workday start time for each workday |
dayend | set | The workday end time for each workday |
daydur | set | The workday duration time for each workday |
Workdays are numbered from 1 (monday) to 7 (sunday).
GetCompetences
Get all competences defined in Microbizz.
Output
competences | collection[ competence ] | All competences |