GetMobileAppSettings

A collection of functions and settings used by the mobile apps to configure itself.

KeywordFunction
AllowRepositionWhen checking in far from an objects location, the user should be allowed to move the position of the object to their current position.
CalendarCreateCreate calendar appointments
CalendarViewAccess to the calendar module
CallLoggingDeprecated
CallsAccess to the sales module
AutoCheckOutAllows Automatically checkout if users have been checked in for longer than their normal workday plus a little extra.
CheckInAllow checkin via app (always set)
CheckInOnEventsAllow to check in on events (which will check in on the customer assigned to the event)
CheckInOnProductionAllow to check in on planning (which will check in on the planned task)
Checkout_FormRequiredWhen checking out, any checkout form is mandatory to fill in.
Checkout_Registration_NoneWhen checking out, a time registration should never be posted.
Checkout_Registration_Optional_OffWhen checking out, the user should be able to select if a time registration should be made. This should default to off.
Checkout_Registration_Optional_OnWhen checking out, the user should be able to select if a time registration should be made. This should default to on.
Checkout_Registration_RequiredWhen checking out, a time registration is mandatory.
CustomersCreateThe user may create new CRM objects from the app.
CustomersDrawThe user is allowed to draw map objects on customers.
CustomersEditThe user may edit CRM objects from the app.
CustomersFilesFiles are accessible on CRM objects.
CustomersFloorplanDeprecated
CustomersFormsAllow filling forms on customers.
CustomersNotesAccess to customer notes.
CustomersPhotoUser may take photos on CRM objects.
CustomersProceduresProcedures are visible on CRM objects.
CustomersViewAccess to the CRM module
CustomRegistrationsIf Custom registrations are allowed
DayCheckinAllow the user to check in on the day (deprecated?)
DriveDeprecated
EnableNFCEnable NFC functionality
LimitNumObjectsThe app should use the special strategy for reduced object count
LocationLoggingThe app should passively track the user location.
ManyProducts100KThis is set if there are more than 100000 products in the DB, the app may use this to adjust how it synchronizes products
ManyProducts10KThis is set if there are more than 10000 products in the DB (but less than 100000)
NewMessagesEnable the new message system
NewNotesEnable the new note system
NoCustomerCheckinCheckin isn't allowed on CRM objects
NoCustomerRegistrationIt isn't allowed to register time on CRM objects
NoEditTimeAtCheckoutTime is not allowed to be edited when checking out
NoEditTimeIt is not allowed to edit/delete own registrations - but it is still allowed to create registrations
NoProximityAlertIf the option named “Alert when close to a task or company?” isn't set, then this keyword is present
NotePostAllow to post notes (always present)
PersonEditAllow to edit person
PersonViewAccess to the person module
PersonalDocumentsAllows to see personal documents (which are files under the current user)
Project2EnabledAccess to the process module (unused?)
PlaceOrderAccess to the sales module
ProdplanAhead<n>Limits the number of days one should be able to look forward in the production plan where <n> is the number of days; if the value is 0 or not specified then it should be considered to mean "forever"
ProdplanReveal<clock>When is the next day revealed in the production plan, where <clock> is the timestamp.
ProdplanViewAccess to the planning module
ProdplanEditAllow editing a plannings
ProductEditAllow product edit
ProductViewDeprecated
QRLoggingEnables the QR scanner
Registration_ClockRegistration is with time stamps instead of minutes, so 12:00-14:00 instead of 120 minutes.
Registration_Star1The blue star should be present
Registration_Star2The yellow star should be present
Registration_Star3The green star should be present
Registration_Star4The red star should be present
RegistrationThe user should be able to register time
RegistrationMidnightToFirstDateWhen registering time over midnight, the selected date should be the first day ie. 01-01-2000 23:00:00 - 01:00:00
RegistrationMidnightToSecondDateWhen registering time over midnight, the selected date should be the second day ie. 02-01-2000 23:00:00 - 01:00:00
RegistrationOnClosedOffDo not allow registrering time on a closed task
RegistrationOnClosedAlwaysAllow registrering time on a closed task
RegistrationOnClosedUntilMidnightAllow registrering time on a closed task, but only on the date when the task was closed
StockUse stock functions
StockRequiredStock is required to be selected when adding a product use.
TodoChangeStateAllow changing status on task
TodoCloseDays<N>How long after task closure will MB keep sending info about the closed tasks, f.ex. "TodoCloseDays90" for 90 days.
TodoCreateAllow creation of new tasks
TodoDrawThe user is allowed to draw map objects on tasks.
TodoEditThe user may edit todo objects from the app.
TodoFilesFiles are accessible on task objects.
TodoFormsAllow filling out forms.
TodoHideAllDon't show the “all tasks” tab in app v2
TodoHideProjectsDon't show projects
TodoNotesAllow notes on tasks.
TodoPhotoUser may take photos on task objects.
TodoPlanAllow planning the task.
TodoPlannedTabsShow planned tab in app v2
TodoProductsAllows product use on tasks.
TodoShowProjectFilesShow project files amongst the other files for a task
TodoTeamTabsShow tabs for each team (in app v2?)
TodoViewAccess to the task module
ToolCreateTaskAllow creating tasks on tool
ToolDetachAllow to detach tool.
ToolDrawThe user is allowed to draw map objects on tool.
ToolEditThe user may edit tools.
ToolFilesFiles are accessible on tool objects.
ToolFormsFill forms on tools
ToolInstallAllow installing tool
ToolNotesAllows notes on tools.
ToolPhotoUser may take photos on tool objects.
ToolPlaceOfHomeAllow to change the tool place of home.
TodoProductUseSearchIf you can search for productuse
TodoProductUseCreateIf you can create new productuse
TodoProductUseDeleteIf DeleteProductUseByID will delete the product use
TodoProductUseOffsetIf DeleteProductUseByID will offset the product use
ToolChangeStateChange state of tools
ToolRegistrationsAllow registration of time on tools
ToolTakeOthersAllows to take tools carried by others
ToolTakeAllows to book tool.
ToolWriteNFCAllow writing of tool NFC tags.
ToolsManualPickupCan pick up tools (always on if tool module available)
ToolsSetDownOnCheckoutAll carried tools should be set down when checkin out
ToolsAccess to tool module
UserEditIf the user is allowed to edit details about himself/herself


Input

permissionsnumberSet to 1 to also read the permissions

Output

functionscollection[string]A collection of functions to enable - see the list above
permissionssetA set of module names and the list of enabled permissions for each module
settingssetVarious settings
defaultstocknumberMB ID of the default stock
minutestepsnumberGranularity when selecting a duration in minutes; default 5

The following settings may be provided in the settings field:

imagenodateandlocationbooleanIf 1 then don't insert time+date+location in the photos

GetAccessToken

Get an access token that can be used with endpoint_token.php instead of using endpoint.php.

Input

None--

Output

accesstokenstringAn access token that should be passed to endpoint_token.php
expiredatedateWhen then token expires
expiretimetimeWhen the token expires

LogOut

Log out of the system, should be called by the app when the user logs out. The main purpose is to clear the push token.

Input

pushtokenstringThe push token that was last sent from this app

Output

None

Log

Log a string to the Microbizz API log

Input

textstringString to log
mailbooleanSet to true to send the log to drift@microbizz.dk

Output

None--

Configuration

GetWorkareas

Get all Microbizz workareas. All workareas are returned, and replaces earlier workareas.

Input

None--

Output

workareascollection[ workarea ]A collection of all work areas in the Microbizz system.

Get a list of custom links to inject into the app. This allows server side content/functionality to be displayed in the app. These should be accessible somewhere, preferable via an icon. The URL should be displayed in a browser window within the app.

Input

None--

Output

Collection of:

iconnumberEt tal der angiver hvilket ikon app'en skal vise: 1 – Start (huset) 2 – Virksomheder 3 – Opgaver 4 – QR 5 – Timer 6 – Person 7 – Opkald 8 – Udstyr 9 – Plan 10 – Bruger
titlestringTitle of icon
urlstringLink to functionality

GetCustomFields

Get info about all Custom fields.

Custom fields are fields that Microbizz users may add to various objects, like todo or customer. There are several types of custom fields, see Custom fields.

Input

None--

Output

fieldssetThe name of each item is a module code/object type, and the value is a collection of customfields

GetColumnGroups

Get info about column groups. A columngroup specifies the content of a box that is to be displayed in the app.

Input

None--

Output

columngroupscollection[object]List of column groups

Each column group contains

idnumberThe ID of the column group
objecttypestringThe type of object this group describes
titlestringThe title of the group
purposenumberSee below
columnscollection[string]LIst of the fields included in the group
titlescollection[columntitle]The titles of the columns, may include other info
appiconscollection[appicon]The app icons to use


objecttype can be either of "todo", "person", "users", "tools", "customers", "prodplan", "calendar", "todo_productuse", "sales_product" or "project".

purpose indicates under which circumstances the group should be used: 0 - anytime, 1 - object main page, 2 - secondary text, 3 - sub object.

columns contain a list of field names. See 3-parts notation below.

appicons is a collection of objects which specify the icons to use with the column; each object has with the following fields:

iconthe name of an icon to use
columnthe name of the column for which this icon should be used

titles is a collection of objects which specify the titles of the columns, it may also include other info about the column; each obhect has the following fields:

titlethe title of this column
columnthe name of the column for which this title should be used
iscustomfield

optional, is 1 if the column is a custom field

customfieldtypethe type of the custom field, only if iscustomfield is set to 1, seeCustom fields for details about the types
customfieldsubtypethe subtype of the customfield, only if iscustomfield is set to 1
typethe type of the field, currently this is only relevant for Ventu


3-parts notation

Some object types may refer to fields from other object types, f.ex. the planning (object type = prodplan) may refer to fields from the associated task. This is specified by a field name consisting of 3 parts separated by . (full stop). F.ex. if a column group for prodplan (see prodplanentry) includes the field todoid.todo.customertext then this means that the value in field todoid in the prodplanentry is the ID of an object of type todo, and you should use the field customertext from the todo object.

So the first part (todoid) refers to a field in the object for which the column group applies. The second part (todo) indicates another object type. The third part (customertext) indicates a field in the other object type - this is the value to display.

GetMainPages

Get info about which boxes to display on an object main page.

Input

None--

Output

mainpagescollection[ mainpage ]List of main pages

There is one mainpage object for each of the object types todo/customers/person/tools.

GetAllWidgets

Get info about which widgets are available; widgets are referenced by main pages, see mainpagebox.

Input

None--

Output

widgetscollection[ widget ]List of widgets

GetCheckpoints

Get all Microbizz cheeckpoints. All checkpoints are returned, and replaces earlier checkpoints.

Input

None--

Output

checkpointscollection[ checkpoint ]A collection of all checkpoints in the Microbizz system.

Checkpoints are saved when calling DoCheckOut or DoCheckOutForUser.

GetIcons

Get all Microbizz icons. All icons are returned and replaces earlier icons.

Input

md5sumscollection[ md5list ]The known MD5 sums of icons for custom fields etc
appiconscollection[md5list]The known MD5 sums of app icons

Output

iconscollection[ icon ]A collection of all icons in the Microbizz system.
appiconscollection [appicon]A collection of all the app icons; only included if appicons is set in the input

An appicon object contains the fields id, data and md5sum. The id field holds the icon name, eg map1.png; the same name/id should be used in the md5list in the input.

No image data will be transferred for the icons (or app icons) which match the supplied MD5 sums.

GetCurrentUserID

Get the user ID of the current user.

Input

None--

Output

useridnumberThe user id of the current user.

SetUserPassword

Set the password for the current user. Optionally also set name and mobile phone no.

Input

passwordstringThe MD5 sum of the new password; must be lowercase.
oldpasswordstringThe MD5 sum of the old password; must be lowercase.
fullnamestringThe full name of the user, eg. “Bill Clinton”
mobilestringThe mobile phoneno of the user, eg. “+4512345678”

Output

None--

Workplan

GetWorkplanForDates

Get the workplan for the current user

Input

fromdatedate-
todatedate-
useridnumberThe MB ID of a user; if not specified then return data for the current user
busybooleanIf 1 then include workdayduration and busyminutes fields in the result

Output

workplanentriescollection [ workplanentry ]The workplan

GetPastRegistrations

Get the daily worksheets and workplan for the current user.

Input

startdatedate-
enddatedate-

Output

weekssetThe worksheets, grouped by weeks and dates
workplancollection [workplantype]

A workplantype contains the fields id,color and title.

The weeks set contains an entry for each week in the period; the field is date of the monday in the week and the value is another set containing the fields following fields:

Values in the weeks set:

fieldtype
weeknonumberweek number
enddatedate of the sunday in the week
hoursnumbertotal number of minutes registered by current user in the week
datessetThe fields are the dates in the week, the values are yet another set, see below


Values in the dates set:

fieldtype
hoursnumbertotal number of minutes registered by current user on the date
workplannumberthe workplan registration type for the date, see the regtypeid field in workplanentry
isopenboolean1 if the worksheet for the date is open, 0 if it is is closed

Notes

Notes are deprecated, use the message commands instead.

GetNotesByLastChange

Get the notes from beginning to end.

fieldtype
objecttypestringthe type of parent. example 'todo'
objectidnumberthe id of the parent. Example the todo it's connected to.
changedatedatelast time it was changed.
changetimetime(optional) the last time it was changed.

GetNotes

Get all notes belonging to the specified object

Input

objecttypestringThe type of the object for which to retrieve notes. Either “customer” or “todo”
objectidnumberThe id of the object for which to retrieve notes.

Output

notescollection[note]The notes

PostNote

Post a note. A note ID must be provided, even though it is ignored. It can be set to 0.

Input

notenoteThe note to post
messagesetIf the note should also spawn a message

Output

notenoteThe note as it was created in the system.

The message set holds two fields: remoteid which is the user ID of the receiver, and confirmation which determines in the message requires confirmation.

There are two special values for remoteid: 1000000000 - sends to the responsible user for whatever object the note belongs to, and 1000000001 - sends to the next user who checks in on the task or customer that the note belongs to.

SearchProvider

Search Microbizz for customers, person, todo, tool, product

Input

searchstringThe search term
objecttypescollection[string]Which objects to search, you may call this field "modcodes" instead, see below for a list of possible objecttypes
referencemixedSee below
textsearchboolSet to 0 to return just the IDs of the matching objects, set to 1 to return also a string that describes the object (typically the object name) 

Output

objectssetThe keys are the object types, the values are sets of the matching results

Object types

objecttypefields that will be matchedmeaning of the field "reference"
personfirstname, lastname, address, address2, zip, city, country, phone, email

Either:

  1. A company ID, to find only persons associationed with that company, or
  2. A set with two fields: modcode, sysref where modcode must currently be the string "customers" and sysref is then a company ID

customers

customer

name, customernumber, vat, publicid, address, address2, zip, city, country, id, phone, email

A fuzzy search is also performed, so that if the search term looks like the name then it is considered a match


todoname, number, address, address2, requisition
producttitle
tool

name, make, model, serialnumber

If company matches the search term then any equipment that belongs to the company will also match


Stock

GetStocks

Get all Microbizz stocks. All stocks are returned, and replaces earlier stocks.

Input

None--

Output

stockscollection[ stock ]A collection of all stocks in the Microbizz system.

CreateStock

Create a new stock and optionally attach it to an object

Input

stockstockThe stock to create. (Id is ignored)

Output

stockstockThe stock that was created

DeleteStock

Deletes a stock and remove assignment from it, from every user that was assigned.

Input

stockidnumberID of the stock to delete.

Output

None--

AssignStockToUser

Assigns a stock to a user as the users default stock. If no stockid is provided any default stock is removed from the user instead.

Input

useridnumberID of the user to assign / deassign.
stockidnumberID of the stock to assign or empty to deassign.

Output

None--

Depots

AddDepotOrder

Add a depot order based on a depot inventory.

Input

customeridnumberThe ID of the company for which the depot inventory was done
ordercollection[doline]The actual depot inventory
orderdatedateWhen the depot inventory was done
ordertimetimeWhen the depot inventory was done

Output

None--

Each line in order is a set containing the fields depotitemid and ordercount.

See also CreateUpdateDepotOrderLine.

This command may cause the depot order line to be exported.

CreateUpdateDepotOrderLine

Create a new depot order line, or update an existing.

Input

Output

linedepotorderline

See also AddDepotOrder.

GetDepotsByLastChange

Get the depots that have changed recently.

Input

changedatedate-
changetimetime-

Output

depotscollection[depot]A list of the depots that have changed

Files

UpdateDocument

Update the data for a file.

Input

documentidnumber

The internal Microbizz ID of a file/document

filedatastringBase64 encoded binary data
titlestringNew title of the file
filenamestringNew name of the file, notice that the extension (eg. .jpg) must be the same as the existing file

Output

documentdocumentA document object

GetDocumentsByModcodeAndID

Get all documents for a modcode+ID.

Input

modcodestringA modcode
objectidnumberAn object ID
inclthumbsboolTrue to include thumbnails
inclfoldersboolTrue to include folders

Output

documentscollection [ document ]The documents present on the object
folderscollection [folder]The folders present on the object

GetImageTags

Get all Microbizz image tags. All tags are returned and replaces earlier tags.

Input

None--

Output

imagetagscollection[imagetag]A collection of all image tags in the Microbizz system.

GetDocumentByID

Get a specific document providing a document ID

Input

documentidnumberThe id of the document

Output

documentdocumentThe document object
databinaryThe binary data of the document itself

GetPersonalDocuments

Get all personal documents of the current user

Input

inclfoldersboolTrue to include folders

Output

documentscollection [document]The personal documents
folderscollection [folder]The folders in the personal documents area

AddFileToPersonalDocuments

Add a file to the personal documents for the user.

Input

filenamestringThe name of the file, eg. “MyDocument.PDF”
filedatabinaryA binary stream.
titlestringA file title (not a file name)
folderstringThe path of the folder, eg. "FilesFromAPI/Diagrams"

Output

None--

AddPhotoToPersonalDocuments

Add a photo file to the personal documents for the user.

Input

titlestringA file title (not a file name)
imagedatabinaryA binary stream containing photo data in jpeg format. base64_encode(Required)
createdatedateWhen the photo was taken
createtimetimeWhen the photo was taken
tagscollection [number]An optional collection of tags to attach to this image (tag IDs)
documentidnumberOptional ID of an existing file, to update the file instead of creating a new file

Output

documentdocumentA document object

AddPhotoToCustomer

Add a photo file to a specified customer.

Input

titlestringA file title (not a file name)
imagedatabinaryA binary stream containing photo data in jpeg format.
customeridnumberreference to the customer.
createdatedateWhen the photo was taken
createtimetimeWhen the photo was taken
tagscollection [number]An optional collection of tags to attach to this image (tag IDs)
documentidnumberOptional ID of an existing file, to update the file instead of creating a new file
foldernumberOptional ID of a folder, the image should be placed in.
onxnetbooleanif image is public for extranet.
longitudefloatOptional geolocation longitude of the phone at upload.
latitudefloatOptional geolocation latitude of the phone at upload.
commentstringOptional comment on the image.
categorynumberOptional Reference to existing image's file category.
subcategorynumberOptional Reference to existing image's file subcategory.

Output

documentdocumentA document object

AddPhotoToTodo

Add a photo file to a specified Task.

Input

titlestringA file title (not a file name)
imagedatabinaryA binary stream containing photo data in jpeg format.
todoidnumberreference to the task.
createdatedateWhen the photo was taken
createtimetimeWhen the photo was taken
tagscollection [number]An optional collection of tags to attach to this image (tag IDs)
documentidnumberOptional ID of an existing file, to update the file instead of creating a new file
foldernumberOptional ID of a folder, the image should be placed in.
onxnetbooleanif image is public for extranet.
longitudefloatOptional geolocation longitude of the phone at upload.
latitudefloatOptional geolocation latitude of the phone at upload.
commentstringOptional comment on the image.
categorynumberOptional Reference to existing image's file category.
subcategorynumberOptional Reference to existing image's file subcategory.

Output

documentdocumentA document object

AddPhotoToTool

Add a photo file to a specified tool.

Input

titlestringA file title (not a file name)
imagedatabinaryA binary stream containing photo data in jpeg format.
toolidnumberreference to the tool.
createdatedateWhen the photo was taken
createtimetimeWhen the photo was taken
tagscollection [number]An optional collection of tags to attach to this image (tag IDs)
documentidnumberOptional ID of an existing file, to update the file instead of creating a new file
foldernumberOptional ID of a folder, the image should be placed in.
onxnetbooleanif image is public for extranet.
longitudefloatOptional geolocation longitude of the phone at upload.
latitudefloatOptional geolocation latitude of the phone at upload.
commentstringOptional comment on the image.
categorynumberOptional Reference to existing image's file category.
subcategorynumberOptional Reference to existing image's file subcategory.

Output

documentdocumentA document object

GetImageCategories

Get the image categories and their id's.

Input

None--

Output

None--