CreateUpdateTodo

Creates or updates a todo in Microbizz.

If a todo with the given todo id already exists, then the todo will be overwritten.

If the todo provided has a todo id of 0, a new todo will be created and a new todo id will be provided.

If a toolid is provided then the tool will be attached to the todo.

Input

todotodoThe todo to create/update
toolidnumberThe ID of a tool to attach to the todo
changenoteboolIf a change note should be posted and a mail be sent etc; default is 1

Output

todotodoThe todo object as it is in Microbizz after the update

CreateUpdateTodoByTodoNumber

Creates or updates a todo in Microbizz. The todo is identified by the number field in the todo.

If a todo with the given todo number already exists, then the todo will be overwritten, otherwise a new todo will be created and assigned the supplied todo number. Currently no test is made as to the validity of the todo number.

If a toolid is provided then the tool will be attached to the todo.

Input

todotodoThe todo to create/update
toolidnumberThe ID of a tool to attach to the todo
changenoteboolIf a change note should be posted and a mail be sent etc; default is 1

Output

todotodoThe todo object as it is in Microbizz after the update

CloseTodoByID

Closes a todo by todo ID

The todo is only closed if close conditions are fullfilled. The command will not fail, if the todo isn't closed, but the returned object will reflect that the todo is still open

Input

todoidnumberThe ID of the todo which should be closed
stateidnumberThe state to which this todo should be closed to. (Obtained by GetTodoStates). Only close states is allowed here.
answeranswerIf a question form is requested on todo close, then the answers can be provided here.
notenoteA note, only the text field will be used, will be tagged with 'Solution'

Output

todotodoThe todo object as it is in Microbizz after the update

GetTodosByLastChange

Get a collection of todos changed since a given date and time.

Input

changedatedateReturn all todo's changed on or after the provided date.
changetimetimeIf this is provided only return todo's 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
ignoreclosedboolIf 1 then don't send todo's that current user do not have access to
onlyprojectsnumber

If 0 then projects are excluded if the "Hide projects in app and API" setting in MIcrobizz is enabled (this is default)

If 1 then only read projects, ignore the "Hide projects in app and API" setting

If 2 then projects are included even if the "Hide projects in app and API" setting is enabled

If 3 then projects are excluded

limitnumobjectsboolIf 1 then Microbizz will only send todo's that it thinks are particularly relevant for the user
skip_deletedboolIf 1 then don't send deleted tasks

Output

todoscollection[todo]A collection of the relevant todos, or an empty collection if no todosNiko was 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.

GetTodosByCustomerID

Get a collection of todos changed since a given date and time.

Input

customeridintfinds all using this customerid
ignoreclosedboolIf 1 then don't send todo's that current user do not have access to

Output

todoscollection[todo]A collection of the relevant todos, or an empty collection if no todos was found.

GetTodosByEAN

Get a collection of todos changed since a given date and time.

Input

EANintfinds all using this EAN
ignoreclosedboolIf 1 then don't send todo's that current user do not have access to

Output

todoscollection[todo]A collection of the relevant todos, or an empty collection if no todosNiko was found.

GetTodosByRequisition

Get a collection of todos changed since a given date and time.

Input

requisitionstringfinds all using this requisition
ignoreclosedboolIf 1 then don't send todo's that current user do not have access to

Output

todoscollection[todo]A collection of the relevant todos, or an empty collection if no todosNiko was found.

GetTodoByID

Get a todo by their Microbizz todo id

If no such todo exist an empty collection will be returned.

Input

todoidnumberThe microbizz todo id of the todo to fetch

Output

todoscollection[todo]A collection either empty if no todo was found, or with exactly one element being the todo.

GetTodoByTodoNumber

Get a todo by their todo number.

If no such todo exist an empty collection will be returned.

If several todos exists with the provided todo number, only one of these (unpredicted) is returned.

Input

todonumberstringThe todo number of the customer to fetch

Output

todoscollection[ todo ]A collection either empty if no todo was found, or with exactly one element being the todo.

GetTodoLogByID

Get the log for a todo by the ID and date.

If no such todo exist an empty collection will be returned.

If some todo exist in the log with the provided ID and date, will be returned log data.

Input

todoidintegerThe todo number of the customer to fetch
datestringThe date
logtypestringWhich log to read, either db (default) or activity

Output

resultcollection[set]A list of log lines, the contents of each set depends on the logtype parameter

Logtype = db

headstringLog head information. Contains date, time, log level and user ID
textstringLog text information
lognamestringUsed log name
datestringLog date
timestringLog time
levelstringThe level of the log
uidintegerUser ID
objectstringLog object data


Logtype = activity

useridnumberThe Microbizz ID of the user who genereated this log line
customeridnumberThe MB ID of a customer which may be relevant
unitidnumberThe MB ID of a unit which may be relevant
projectidnumberThe MB ID of a project which may be relevant
modcodestringA code for which module generated this log line
datedateWhen the log line was generated
timetime
textstringThe log line, may be HTML
linkstringAn optional link to some page in MB which is relevant


GetTodosByPersonID

Get all todos which have a specific contact person.

Input

personidnumberThe Microbizz ID of the contact person

Output

todoscollection[ todo ]

AddPhotoToTodo

Add a photo file to a todo.

Input

todoidnumberThe ID of the todo to add the photo to.
titlestringA file title (not a file name)
imagedatabinaryA binary stream containing photo data in jpeg format.
onxnetboolean1 if the file should be visible on the extranet
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
folderstringThe path of the folder, eg. "FilesFromAPI/Diagrams"

Output

documentdocumentA document object


AddFileToTodo

Add a file to a task.

Input

todoidnumberThe ID of the task to add the file to.
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--

AddAudioToTodo

Add an audio file to a todo.

Input

todoidnumberThe ID of the todo to add the audio to.
titlestringA file title (not a file name)
formatstringOne of: mp3 wav aac
audiodatabinaryA binary stream containing audio data in the specified format.

Output

None.--

GetTodoTemplates

Get a list of all todo templates.

Input

None.--

Output

templatescollection [ todotemplate ]The available templates

GetTodoStates

Get a list of all todo states.

Input

None.--

Output

statescollection [ todostate ]The available states

CreateTodoFromTemplate

Create a todo based on a given template.

If a toolid is provided then the tool will be attached to the todo.

If tdesc or tdeschtml is set. it will overwrite the template. If none. the template description will be the description.

Input

templateidnumberThe id of the template (which can be obtained by GetTodoTemplates)
titlestringA base title for the created todo
customeridnumberAn id of a customer on which to attach the todo. (In some configurations this is required)
toolidnumberThe ID of a tool to attach to the todo
tdescstringdescription overwritten.
tdeschtmlhtmldescription in html format.

Output

todotodoThe primary todo created from the template. (A template can contain more than one todo)

GetPlannedTodos

Get list of tasks that are planned for the current user.

Input

None--

Output

todoscollection[number]List of IDs of the tasks that are planned for the user.

GetDocumentsByTodoID

Get all documents on a todo by todo id

Input

todoidnumberThe Microbizz todo ID
inclthumbsboolTrue to include thumbnails
inclfoldersboolTrue to include folders

Output

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

GetProductUseByLastChange

Get a collection of all product use since the given date.

Input

changedatedateReturn all product use on or after the provided date.
changetimetimeIf this is provided only return product use 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
include_pricebool1 if prices should be included anyway even it set not to.

Output

productusecollection[ todoitem ]A collection of the relevant product use, or an empty collection if no products were used.
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.

GetProductUseByTodoID

Get a collection of all product use on the given todo.

Input

todoidnumberID of todo to receive product use
include_pricebool1 if prices should be included anyway even it set not to.

Output

productusecollection[ todoitem ]A collection of the relevant product use, or an empty collection if no products were used on this todo.

GetProductUseByToolID

Get a collection of all product use on the given tool.

Input

toolidnumberID of tool to receive product use
sparepartsboolean1 to get spareparts only, 0 to get non-spareparts only
include_pricebool1 if prices should be included anyway even it set not to.

Output

productusecollection[ todoitem ]A collection of the relevant product use, or an empty collection if no products were used with this tool.

DeleteProductUseByID

Delete some product use by product use ID. The command will succeed even if the product use doesn't exist.

Notice that product use may either be deleted or offset. If the user is allowed to delete, then it is deleted, otherwise if the user is allowed to offset then the product use is  offset, otherwise you get an error.

Input

productuseidnumberID of the product use to remove

Output

None--

AddProductUse

Deprecated: Consider using CreateUpdateProductUse

Add product use to the todo specified by the given todo ID.

Input

productusetodoitemThe product use. Even though the id field must be provided, it is ignored.
todoidnumberID of todo to receive product use
nopricecalcbooleanSet to 1 to disable price calculation (eg. when copying product use)
copyidnumberOptional ID of the prod.use that was copied, used for copying some details

Output

None--

AddProductUseFromEDI

Add product use to a task. Discounts and profit calculations will be made on the product use and therefore override this information on the provided object.

Input

productusetodoitemThe product use. Even though the id field must be provided, it is ignored.

Output

None--

AddPartsList

Add product use to the todo specified by the given todo ID. Most of the details will be taken from the parts list setup.

Input

productusecollection[ partuse ]Details about the product used for each part in the parts list.
todoidnumberID of todo to receive product use
useddatedateThe date of use
usedtimetimeThe time of use

Output

None--

CreateUpdateProductUse

Creates or updates some product use in Microbizz.

If some product use with the given productuse id already exists, then the product use will be overwritten.

If the product use provided have a productuse id of 0, new product use will be created and a new productuse id will be provided.

Input

productusetodoitemThe product use to create/update
nopricecalcbooleanSet to 1 to disable price calculation (eg. when copying product use). If this is set and a costprice is provided on the product use; that costprice will always be used.
copyidnumberOptional ID of the prod.use that was copied, used for copying some details

Output

productusetodoitemThe product use object as it is in Microbizz after the update

GetProductUsePendingInvoicing

Get all product use pending invoicing.

Input

include_pricebool1 if prices should be included anyway even it set not to.

Output

productusecollection[ todoitem ]A collection of all product use pending invoicing.

MarkProductUseAsInvoiced

Mark the selected product use as invoiced.

Input

productuseidscollection[number]A collection of all product use ids to mark as invoiced.

Output

None--

GetPlanDestinations

Get all destinations for use when planning a todo

Input

None--

Output

destinationscollection[ plandestination ]A collection of all destinations which can be used.
myselfnumberThe destination that is the user himself

PlanTodo

Plan a todo to a specific destination.

Input

todoidnumberID of the todo to plan.
datedateDate to plan to.
timetimeTime to plan to.
destinationstringThe destination to plan to, see GetPlanDestinations ; may be an array of string, to plan to multiple users/teams.
durationnumberNumber of minutes to plan; must be 0 if enddate is set.
enddatedateIf set then there will be planned for all the dates between 'date' and 'enddate'.
endtimetimeOnly used if enddate is set, in which case it is required.
nonworkingdaysboolIf true then also plan on non-working days.
fulldayboolean1 to create full day planning or 0 to create normal planning; duration+enddate+endtime+time are ignored for full day plannings

Output

prodplanidscollection[number]The Microbizz IDs of all the plannings that were created

destination consist of a letter (either u for user or t for team) followed by a number (the ID of the user/team). Eg. u29 or t3. When planning to a team, the team of the todo will be changed to the specified team, and the planning will be made anonymous.

GetWorkpoolsByLastChange

Get info about the workpools.

Input

changedatedate
changetimetime
skip_deletedboolIf 1 then don't send deleted workpools

Output

disabledboolIf workpools are disabled, default is false
workpoolscollection[ workpool ]A collection of workpools

Each set in workpools contains information about a workpool. The API call will always return all the workpools, but the content (list of tasks) of a workpool will only be included in if the workpool or its contents has changed since changedate.

AddRemoveWorkpoolEntry

Add a Todo to a workpool, or remove a Todo from a workpool.

Input

workpoolentryidnumberID of a workpool entry in Microbizz
todoidnumberID of a Todo in Microbizz
workpoolidnumberID of a workpool in Microbizz

Output

wastakenboolTrue if the Todo was removed from the workpool
workpoolentryworkpoolentryOnly if the Todo was added to a workpool

If workpoolentryid is specified, then the Todo will be removed from the pool, and the responsible user will be set to the current user.

If workpoolentryid isn't specified, but workpoolid and todoid both are, then the Todo will be added to the workpool.

Budget

GetBudgetByTodoID

Read the current budget for a todo.

Input

todoidnumberID of a Todo in Microbizz

Output

budgetsetBudget posts, indexed by the ID of the budget posts
budgetpostnamessetThe names of the budget posts, indexed by the ID of the budget posts
anchorbudgetset

The anchor budget posts, indexed by the ID of the budget posts

Only if anchor budgets are enabled

GetBudgetByLastChange

Read the recent changes to the budgets for all todos.

Input

changedatedateReturn all budgets changed on or after the provided date.
changetimetimeIf this is provided only return budgets 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

budgetscollection[budgetpost]Budget posts
budgetpostnamessetThe names of the budget posts, indexed by the ID of the budget posts

UpdateBudgetByTodoID

Lets the user update the budget for specific tasks.

Input

todoidnumberId of a Todo in Microbizz
valuesarray with numbersspecific numbers that needs to be changed. based on the budgetpostnames.

Output

budgetpostnamessetBudget posts names indexed by budget post ID.
newbudgetcollection[budgets]current budgets of task matching the budgetpost names.

GetAnchorBudgetByLastChange

Read the recent changes to the anchor budgets for all todos. Requires that anchor budgets are enabled.

Input

changedatedateReturn all budgets changed on or after the provided date.
changetimetimeIf this is provided only return budgets 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

anchorbudgetscollection[anchorbudget]Anchor budget posts
budgetpostnamessetThe names of the budget posts, indexed by the ID of the budget posts

UpdateAnchorBudgetByTodoID

Lets the user update the anchor budget for a specific task. Requires that anchor budgets are enabled.

Input

todoidnumberId of a Todo in Microbizz
valuessetThe new anchor budget values, indexed by the ID of the budget post

Output

budgetpostnamessetBudget posts names indexed by budget post ID.
newanchorbudgetsetCurrent anchor budget of the task, indexed by the budget post ID.

State history

GetTodoStateHistoryByID

Get the history of task state changes for a task

Input

todoidnumberMicrobizz ID of a task, return all state changes for that task.

Output

statehistorycollection[todostatehist]State changes

GetTodoStateHistoryByLastChange

Get the recent task state changes.

Input

changedatedateReturn all state changes on or after the provided date.
changetimetimeIf this is provided only return state changes 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

statehistorycollection[todostatehist]State changes

Repeat

GetRepeatsByLastChange

Get recent changes to repetitions, for todos of the type "repeat, exact".

Input

changedatedateReturn all repeat changes on or after the provided date.
changetimetimeIf this is provided only return repeat changes 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

repeatscollection[repeat]Repeat changes

GetRepeatsByTodoID

Get all repetitions for a todo, for todos of the type "repeat, exact".

Input

todoidnumberReturn all repeats for this todo

Output

repeatscollection[repeat]All repeats for the todo

GetWGRepeatsByLastChange

Get recent changes to repetitions, for todos of the type "repeat, loose".

Input

changedatedateReturn all repeat changes on or after the provided date.
changetimetimeIf this is provided only return repeat changes 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

repeatscollection[wgrepeat]Repeat changes

GetWGRepeatsByTodoID

Get all repetitions for a todo, for todos of the type "repeat, loose".

Input

todoidnumberReturn all repeats for this todo

Output

repeatscollection[wgrepeat]All repeats for the todo

GetRepeatExceptionsByTodoID

Get periods where the todo should not be planned by repetitions.

Input

todoidnumberReturn all repeat exception periods for this todo

Output

repeatexceptionsscollection[repeatexception]All repeat exceptions periods for the todo

Each repeatexception holds the following fields: id, startdate, enddate.

GetTodosByField

Get a collection of todos where a given field matches a value.

Input

fieldstring

Return todos where this field has the value specified in value.

Following output is possible by examples:


custom150

This will return a custom field with the ID 150


qref200

This will return a Microbizz field with the ID 200

valuestringReturn todos where the field specified in field has this value.
resumekeystring
include_closedboolean1 if closed tasks should be included.

Output

todoscollection[ tool ]A collection of the relevant todos, or an empty collection if no todos were 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.