AddFileToTool
Add a file to a tool/equipment.
Input
toolid | number | The ID of the tool to add the file to. |
filename | string | The name of the file, eg. “MyDocument.PDF” |
filedata | binary | A binary stream. |
title | string | A file title (not a file name) |
folder | string | The path of the folder, eg. "FilesFromAPI/Diagrams" |
Output
GetMyTools
Get all tools carried by the current user
Input
Output
tools | collection[tool] | Collection of all carried tools, or an empty collection if no tools are carried. |
GetToolTypes
Get all tool types.
Input
Output
types | collection[ tooltype ] | Collection of tooltype objects |
classes | set | List of classes, the key is the class ID, the value is the class name |
GetToolStates
Get all tool states.
Input
Output
types | collection [ toolstate ] | Collection of states, each state is a set with id , title , color and access |
If access
is 0 then the user is not allowed to select the state, but the state may still be displayed whenever a tool/equipment has the state.
ToolAttachToCustomer
Attach a tool to a company.
If the specified customerid is 0 then the tool will be detached.
Input
toolid | number | The ID of a tool |
customerid | number | The ID of a customer |
Output
ToolAttachToTodo
Attach a tool to a todo.
If the specified todoid is 0 then the tool will be detached.
Input
toolid | number | The ID of a tool |
todoid | number | The ID of a todo |
Output
CreateUpdateTool
Creates or updates a tool in Microbizz.
If a tool with the given tool id already exists, then the tool will be overwritten.
If the tool provided has a tool id of 0, a new tool will be created and a new tool id will be provided.
Input
tool | tool | The tool to create/update |
attachto | object | An object with objecttype and objectid |
noactivate | boolean | Set to 1 to prevent the tool from being assigned to current user and activated |
If attachto
is specified then the tool will be attached to the object; the only objecttype that is supported is 'todo'.
Output
tool | tool | The tool object as it is in Microbizz after the update |
GetToolsByLastChange
Get a collection of tools changed since a given date and time.
Input
changedate | date | Return all tools on or after the provided date. |
changetime | time | If this is provided only return tools changed after the provided date and time. |
resumekey | string | If a partial result is returned, provide the resumekey received along with the partial result, to get the rest of the entries |
ignoreclosed | bool | If 1 then don't sent tools that current user do not have access to |
placeofhome | number | If 1 then only get tools which have a “place of home”, if 2 then only get tools which do not have a “place of home” |
Output
tools | collection[ tool ] | A collection of the relevant tools, or an empty collection if no tools were found. |
resumekey | string | Sometimes 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. |
customerids | collection[number] | List of Microbizz ID of customers which have tools which the app should download in order to ensure that the tools are available in case the app is offline, see GetToolsByField |
GetToolsByTodoID
Get a collection of tools that are attached to a task.
Input
todoid | number | Return all tools that are attached to the task with this ID. |
knowntools | collection[tooldate] | List of known tools and their change dates |
Output
tools | collection[tool] | A collection of the relevant tools, or an empty collection if no tools were found. |
Each tooldate object should contain the following fields:
toolid | number | The Microbizz ID of a tool |
changedate | date | The changedate field from the tool |
changetime | time | The changetime field from the tool |
Microbizz may use this information to avoid sending tools that have not changed.
GetToolsByField
Get a collection of tools where a given field matches a value.
Input
field | string | Return tools where this field has the value specified in value . |
value | string | Return tools where the field specified in field has this value. |
knowntools | collection[tooldate] | List of known tools and their change dates, see GetToolsByTodoID |
resumekey | string |
|
Output
tools | collection[ tool ] | A collection of the relevant tools, or an empty collection if no tools were found. |
resumekey | string | Sometimes 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. |
GetToolByID
Get a tool by their Microbizz tool id
If no such tool exist an empty collection will be returned.
Input
toolid | number | The microbizz tool id of the tool to fetch |
Output
tools | collection[tool] | A collection either empty if no tool was found, or with exactly one element being the tool. |
GetNearbyTools
Get all tools near the given coordinate
Input
longitude | float | GPS longitude |
latitude | float | GPS latitude |
Output
tools | collection[tool] | Collection of all nearby tools (if any). |
PickupTool
Pick up the tool with the given ID. This command will always succeed, but the return variable indicates if the tool was actually picked up.
Input
toolid | number | ID of the tool, to be picked up. |
longitude | float | GPS longitude where the tool was picked up |
latitude | float | GPS latitude where the tool was picked up |
Output
waspickedup | boolean | Indicates if the tool was picked up. |
tool | tool | If the tool was picked up, the tool object is provided in this field. |
message | string | Additional message to display regarding the pickup. |
SetDownTool
Sets down the tool with the given ID. This command will always succeed, but the return variable indicates if the tool was actually set down.
Input
toolid | number | ID of the tool, to be set down. |
answer | answer | If a question form is requested on set down, the answer can be provided here. |
longitude | float | GPS longitude where the tool is set down |
latitude | float | GPS latitude where the tool is set down |
Output
wassetdown | boolean | Indicates if the tool was set down. |
UseTool
Uses the tool with the given ID.
Input
toolid | number | ID of the tool, to be used. |
longitude | float | GPS longitude where the tool was used |
latitude | float | GPS latitude where the tool was used |
date | date | Date of usage |
time | time | Time of usage |
Output
InstallTool
Installs the tool with the given ID at the current location.
Input
toolid | number | ID of the tool, to be used. |
longitude | float | GPS longitude where the tool was installed |
latitude | float | GPS latitude where the tool was installed |
date | date | Date of usage |
time | time | Time of usage |
Output
ToolServiceProtocol
This reports a completed equipment service/inspection.
Input
toolid | number | ID of the tool which was serviced |
answers | set | The answers from each of the question forms that were filled in |
date | date | Date of the service |
time | time | Time of the service |
protocolid | number | The ID of the service protocol that was executed; if not specified then MB will assume it was the first in the list |
todos | set | A list of task IDs; the task ID is the value, the question form ID is the key |
The answers
set has the question form ID as name (or key) and a formanswer as value.
Output
GetToolServiceProtocols
Get the list of available tool service protocols.
Input
multiple | bool | Indicates that the app understands having multiple service protocols |
asarray | bool | Indcate that the result should be send as a collection, instead of as a set |
Output
protocols | set | List of service protocols |
The list in protocols
uses the equipment type ID as key.
If multiple
isn't set then each item in the list is a collection of question form IDs.
If multiple
is set then each item in the list is a set of serviceprotocol objects. If asarray
is set then the list if a collection, an each serviceprotocol object includes a groupid
field indicating the ID of the tool type.