Todo commands

Todo commands

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.

If sendsubcontractormail is set, then a mail is sent to the subcontractor, if any.

Input

todo

todo

The todo to create/update

toolid

number

The ID of a tool to attach to the todo

changenote

bool

If a change note should be posted and a mail be sent etc; default is 1

sendsubcontractormail

bool

Sends a mail to subcontractor

Output

todo

todo

The 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

todo

todo

The todo to create/update

toolid

number

The ID of a tool to attach to the todo

changenote

bool

If a change note should be posted and a mail be sent etc; default is 1

Output

todo

todo

The 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

todoid

number

The ID of the todo which should be closed

stateid

number

The state to which this todo should be closed to. (Obtained by GetTodoStates). Only close states is allowed here.

answer

answer

If a question form is requested on todo close, then the answers can be provided here.

note

note

A note, only the text field will be used, will be tagged with 'Solution'

Output

todo

todo

The todo object as it is in Microbizz after the update

GetTodosByLastChange

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

Input

changedate

date

Return all todo's changed on or after the provided date.

changetime

time

If this is provided only return todo's 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 send todo's that current user do not have access to

onlyprojects

number

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

limitnumobjects

bool

If 1 then Microbizz will only send todo's that it thinks are particularly relevant for the user

skip_deleted

bool

If 1 then don't send deleted tasks

Output

todos

collection[todo]

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

Notice that the result may be affected by the setting "Send closed tasks to the app this many days after closing". Also, if the remote agent is the Microbizz App 3 then the setting may be in a different way.

GetTodosByCustomerID

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

Input

customerid

int

finds all using this customerid

ignoreclosed

bool

If 1 then don't send todo's that current user do not have access to

Output

todos

collection[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

EAN

int

finds all using this EAN

ignoreclosed

bool

If 1 then don't send todo's that current user do not have access to

Output

todos

collection[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

requisition

string

finds all using this requisition

ignoreclosed

bool

If 1 then don't send todo's that current user do not have access to

Output

todos

collection[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

todoid

number

The microbizz todo id of the todo to fetch

Output

todos

collection[todo]

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

GetTodosByIDs

Get several todos at the same time by a set of Microbizz todo ids

Input

todoids

collection[number]

A collection of microbizz todo ids of the todos to fetch

Output

todos

collection[todo]

A collection either empty if no todos was found, or with all the found todos (in no particular order)

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

todonumber

string

The todo number of the customer to fetch

Output

todos

collection[ todo ]

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

GetTodosByFilterID

Get all todos which have a specific filter.

Input

filterid

number

The Microbizz ID of the filter

Output

todos

collection[ 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

todoid

integer

The todo number of the customer to fetch

date

string

The date

logtype

string

Which log to read, either db (default) or activity

Output

result

collection[set]

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

Logtype = db

head

string

Log head information. Contains date, time, log level and user ID

text

string

Log text information

logname

string

Used log name

date

string

Log date

time

string

Log time

level

string

The level of the log

uid

integer

User ID

object

string

Log object data

 

Logtype = activity

userid

number

The Microbizz ID of the user who genereated this log line

customerid

number

The MB ID of a customer which may be relevant

unitid

number

The MB ID of a unit which may be relevant

projectid

number

The MB ID of a project which may be relevant

modcode

string

A code for which module generated this log line

date

date

When the log line was generated

time

time

 

text

string

The log line, may be HTML

link

string

An optional link to some page in MB which is relevant

 

GetTodosByField

Get a collection of todos where a given field matches a value. Notice that this call operates directly on fieds in the database, so fields should be specified by their name in the database - ask Microbizz about this. This also means that it doesn’t work for custom fields that are not searchable.

Input

field

string

Return todos where this field matches the value specified in value. Notice that the partial matches are allowed, so if the field is a date field then searching for “2025” will find all tasks where the date is sometime in 2025.

value

string

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

resumekey

string

 

include_closed

boolean

1 if closed tasks should be included.

Output

todos

collection[ todo ]

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

 

GetTodosByPersonID

Get all todos which have a specific contact person.

Input

personid

number

The Microbizz ID of the contact person

Output

todos

collection[ todo ]

 

AddPhotoToTodo

Add a photo file to a todo.

Input

todoid

number

The ID of the todo to add the photo to.

title

string

A file title (not a file name)

imagedata

binary

A binary stream containing photo data in jpeg format.

onxnet

boolean

1 if the file should be visible on the extranet

createdate

date

When the photo was taken

createtime

time

When the photo was taken

tags

collection [number]

An optional collection of tags to attach to this image (tag IDs)

documentid

number

Optional ID of an existing file, to update the file instead of creating a new file

folder

string

The path of the folder, eg. "FilesFromAPI/Diagrams"