Class: WebHook


new WebHook()

WebHook describes a webhook which can trigger on certain events (signals)

Name Type Description
name string

the name

address string

the url which will be called

topic string

the topic name ('item.changelocation', 'item.changegeo', 'item.expire', ...)

hookFields string

the fields which should be fetched from the db (default: `, location., items., customer.)

format string

the output format (only json is supported)

created Moment

the creation date of the webhook

modified Moment

the modified date of the webhook

enabled boolean

whether or not the webhook is enabled

log10 array

the last 10 logs of the webhook

fails int

the number of consequtive fails

minutes int

only for due and overdue webhooks, non-negative




Checks via the api if we can delete the WebHook document

inherited create(skipRead){promise}

Creates an object by the default api.create

Name Type Description

skips reading the response via _fromJson (false)

inherited delete(){promise}

Deletes an object by the default api.delete

inherited discardChanges(){promise}

Discards any changes made to the object from the previously loaded raw response or resets it when no old raw response was found

inherited existsInDb(){boolean}

Checks if the document exists in the database

inherited get(_fields){promise}

Gets an object by the default api.get

Name Type Description

inherited isDirty(){boolean}

Checks if the object needs to be saved We don't check any of the keyvalues (or comments, attachments) here


Checks if the object is empty, it never is


Checks if the webhook has any validation errors


Checks if address is valid


Checks if name is valid

inherited reload(_fields){promise}

Reloads the object from db

Name Type Description

inherited reset(){promise}

Resets the object

inherited update(skipRead){promise}

Updates an object by the default api.update

Name Type Description

skips reading the response via _fromJson (false)