Document toolboxDocument toolbox

Location commands

DoCheckIn

Performs a checkin on an object

Input

objecttypestringThe object type to check in on. Can be: Customer Todo
objectidnumberThe ID of the object to check in on. In case of a Customer this will be the Customer ID and in case of a Todo this will be the Todo ID
checkindatedateDate of checkin
checkintimetimeTime of checkin
longitudefloatGPS longitude from where the user performed the checkin
latitudefloatGPS latitude from where the user performed the checkin
toolidnumberIf a tool is to be included in this checkin, then the ID of the tool can be provided here.

Output

daycheckindatedateDaycheckin date, if checked in on a day
checkinidnumberThe MB ID of the check in, should be quoted when calling DoCheckOut

If the command completes, the checkin is successful.

DoDayCheckIn

Performs a checkin from the day.

Input

checkindatedateDate of checkin
checkintimetimeTime of checkin
longitudefloatGPS longitude from where the user performed the checkin
latitudefloatGPS latitude from where the user performed the checkin

Output

daycheckindatedateDaycheckin date, if checked in on a day
daycheckintimetimeDaycheckin time, if checked in on a day

If the command completes, the checkin is successful.

DoCheckInForUser

Performs a checkin on an object, for another user

Input

objecttypestringThe object type to check in on. Can be: Customer Todo
objectidnumberThe ID of the object to check in on. In case of a Customer this will be the Customer ID and in case of a Todo this will be the Todo ID
checkindatedateDate of checkin
checkintimetimeTime of checkin
longitudefloatGPS longitude from where the user performed the checkin
latitudefloatGPS latitude from where the user performed the checkin
useridnumberThe ID of the user who will be checked in

Output

None. If the command completes, the checkin is successful.--

GetCheckIn

Get a current checkin (if any) on a user.

Input

None--

Output

ischeckedinbooleanTrue if checked in
checkinidnumberThe MB ID of the check in
readablestringA readable representation of the current checked in object
objecttypestringThe object type checked in on. Can be: Customer Todo
objectidnumberThe ID of the object to check in on. In case of a Customer this will be the Customer ID and in case of a Todo this will be the Todo ID
checkindatedateDate of checkin, only set if ischeckedin=1
checkintimetimeTime of checkin, only set if ischeckedin=1
daycheckindatedateThe current date that the user is checked in on, if any
daycheckintimetimeWhen the user checked in on the day, if any
checkoutdatedateDate of last checkout, only set if ischeckedin=0
checkouttimetimeTime of last checkout, only set if ischeckedin=0
toolidnumberThe ID of an equipment that was selected when checking in, or 0 if nothing was selected

GetCheckinsByLastChange

Get all checkins since a given time.

Input

changedatedateReturn all checkins changed on or after the provided date.
changetimetimeIf this is provided only return checkins changed after the provided date and time.
resumekeystringIf a partial result is returned, provide the resumekey received along with the partial result, to get the rest of the entries

Output

checkinscollection[checkin]A collection of the relevant checkins or an empty collection if none is found.
resumekeystringSometimes the entire result cannot be returned because it's to large. In that case a resumekey is returned along with the results. Execute the command again with this resumekey to get the remaining results.

GetAllCheckins

Get all checkins for a given task or company.

Input

objecttypestringEither the string "Todo" or the string "Customer"
objectidnumberThe Microbizz ID of a task or company. 

Output

checkinscollection[checkin]A collection of the relevant checkins or an empty collection if none is found.

DoCheckOut

Performs a checkout of the currently checked in object. As this is always given, there is no need to provide information about what one is checking out from.

Input

checkoutdatedateDate of checkin
checkouttimetimeTime of checkin
longitudefloatGPS longitude from where the user performed the checkout
latitudefloatGPS latitude from where the user performed the checkout
registrationregistrationentryOptional time registration. The only fields used in this object is the workarea, the note and the stars, so the rest can be ignored.
checklistcollection[number]A list of checkpoints completed on this checkin.
answeranswerAn optional answer for the checkout form for a task
checkinidnumberThe MB ID of the check in, from DoCheckIn; used for additional validation
dodrivebooleanIf product use should be registered for driving (only if the Drive module is installed and configured for manual registration)

Output

daycheckindatedateDaycheckin date, if checked in on a day

If the command completes, the checkout is successful.

DoDayCheckOut

Performs a checkout from the day.

Input

checkoutdatedateDate of checkout
checkouttimetimeTime of checkout
longitudefloatGPS longitude from where the user performed the checkout
latitudefloatGPS latitude from where the user performed the checkout

Output

daycheckindatedateDaycheckin date, if checked in on a day
daycheckintimetimeDaycheckin time, if checked in on a day

If the command completes, the checkout is successful.

DoCheckOutForUser

Performs a checkout of the currently checked in object, for another user. As this is always given, there is no need to provide information about what one is checking out from.

Input

checkoutdatedateDate of checkin
checkouttimetimeTime of checkin
longitudefloatGPS longitude from where the user performed the checkout
latitudefloatGPS latitude from where the user performed the checkout
UseridNumberThe ID of the user to check out
registrationregistrationentryOptional time registration. The only fields used in this object is the workarea, the note and the stars, so the rest can be ignored.
checklistcollection[number]A list of checkpoints completed on this checkin.
dodrivebooleanIf product use should be registered for driving (only if the Drive module is installed and configured for manual registration)

Output

None. If the command completes, the checkout is successful.--

GetGPSConfig

Retrieve the current GPS configuration from the system. This is used to track the users location.

The gps_policy field determines if the user should be tracked always or during work hours or never.

Input

None.--

Output

resolutionnumber1 – Use low resolution. 2 – Use medium resolution. 3 – Use high resolution.
intervalnumberNumber of minutes between each poll; if seconds is specified and is > 0 then ignore interval
secondsnumberNumber of seconds between each poll, if == 0 or not specified then use interval minutes
workweeksetContains daystart and dayend which specifies the work hours for each day.
workplancollectionThe workplan for the next week
gps_policynumber1: never track the user, 2: only track during work hours, 3: always track
gps_intervalnumber

interval or seconds are used to determined how often to call RegisterRawGPSLocation.

If workweek is specified then it can be used to determine the work hours for each week day.

If workplan is specified then it specifies the workplan for the next week or so. Each object contains the fields date and atwork. If the atwork field is set to 0 then the user isn't at work on that date.

RegisterIMEIGPSLocation

Register the location of a unit with an IMEI.

Input

imeistringIMEI number
longitudefloatGPS longitude
latitudefloatGPS latitude
datedateDate at position. If not provided, the current date is used.
timetimeTime at position. If not provided, the current time is used.
routeidnumberThe ID of a route, if a route is currently being driven

Output

None.--

RegisterRawGPSLocation

Register the location of a given user, without other context than the GPS position

Input

longitudefloatGPS longitude
latitudefloatGPS latitude
datedateDate at position. If not provided, the current date is used.
timetimeTime at position. If not provided, the current time is used.
precisionfloatOptional accuracy in meters

Output

None.--

A mobile app should call this regularly if the function LocationLogging is enabled (see GetMobileAppSettings). The interval and other settings is returned by GetGPSConfig.

ProcessQRCode

Send a QR code to the Microbizz system for processing.

Input

qrstringThe scanned QR code.
longitudefloatGPS longitude where the code was scanned
latitudefloatGPS latitude where the code was scanned

Output

acceptedbooleanIndicate if the Microbizz system could handle the code.
responsestringA message to display to the user