...
This POST should consist of a single field called request which is a JSON structure describing how you want to connect to Microbizz.
publicid | string | Here you should put your application key. |
---|---|---|
negotiateurl | string | The complete URL to your negotiation script. |
returnurl | string | The user will be returned to this URL when finished connecting. |
hooks | array | A request of one or more hooks into the Microbizz system. |
Hook elements are formed like this:
modcode | string | A module code to identify a part of the Microbizz system. |
---|---|---|
hook | string | A hook keyword to identify what you want to "hook". |
title | string | A human readable title of your hook. |
url | string | The complete URL to the endpoint at your system which will be servicing this hook. |
Example request: https://system.microbizz.dk/appconnect/?request={"publicid":"MY APPLICATION KEY","negotiateurl":"https://MYSERVER/negotiate/","returnurl":"https://MYSERVER/return/", hooks:[{"modcode":"invoice","hook":"menu","title":"My invoice plugin","url":"https://MYSERVER/myplugin/"}]}
...
During the connect process your negotiation script will receive a POST consisting of the following fields:
endpoint | string | The URL to be used for communicating with the Microbizz API. |
---|---|---|
contract | string | The Microbizz contract number for the user who connected. |
accesstoken | string | An accesstoken allowing you access into the users Microbizz solution. |
challenge | string | A challenge string to prove the identity of your app. |
You should store the first three pieces of information in your application, as this is your access information to Microbizz.
...
There are two types of endpoints. Event endpoints and interface endpoints. In the chart below you can see every Microbizz hook, the type of endpoint and what parameters are passed to the endpoint.
Modcode | Hook | Endpoint type | Event / position | Variables |
---|---|---|---|---|
invoice | event_invoice_line_change | Event | Called every time an invoice line is changed in Microbizz. | object: The invoice line object that was changed as JSON. |
todo | event_product_use_change | Event | Called every time a line of product use is changed in Microbizz. | object: The productuse object that was changed as JSON. |
user | menu | Interface | Adds a menu item in the user module. | |
user | tab | Interface | Adds a tab below every user tab in Microbizz. | id: The internal Microbizz ID of the user displayed. usercode: The user code of the user displayed. |
Interface endpoint
An interface endpoint is iframed into Microbizz, so the output of your script will be displayed inline in the Microbizz system. All variables are passed as GET variables. In addition to the variables mentioned in the chart above, you'll always receive a variable named sessiontoken which is the sessiontoken of the current Microbizz user. You can use the ValidateSessionToken API command to validate this session token, to ensure that your URL is actually called from the Microbizz system and not spoofed from somewhere else. You should use this call before outputting any information.
...
An event endpoint is called by the Microbizz system, and all variables are passed as POST variables. The event endpoint should output a json structure with the following fields:
status | boolean | True if everything went well, otherwise false. |
---|---|---|
error | string | If an error occurred a detailed error message can be relayed in this field. |
If this JSON structure isn't returned, the request is also considered to have failed.