Skip to main content
Skip table of contents

Microbizz REST API

Authentication:

  • To Stay Logged In: Use an access token. The preferred method is a Bearer Token, where the value to look for is access_token.

Base URLs:

  • New Part: /Microbizz/Api/php/microbizz.php/CONTRACT_NUMBER/

  • Old Part: /api/rest/v1/microbizz.php/CONTRACT_NUMBER/

API Endpoints:

  1. Get Access Token:

    • Endpoint: /getaccesstoken?username=&password=

    • Method: GET

    • Description: Retrieves an access token for authentication.

  2. Retrieve Object:

    • Endpoint: /OBJECT/OBJECTID

    • Method: GET

    • Description: Fetches details of an object by its ID.

  3. Find Objects with Query:

    • Endpoint: /OBJECT?query={"type": "GreaterEqual", "fieldname": "", "value": "2024-05-18 09:13:50"}

    • Method: GET (FIND)

    • Description: Searches for objects based on a query.

  4. Create Object:

    • Endpoint: /OBJECT

    • Method: POST (CREATE)

    • Description: Creates a new object with JSON data in the request body.

  5. Update Object:

    • Endpoint: /OBJECT/OBJECTID

    • Method: POST (EDIT)

    • Description: Updates an existing object with JSON data in the request body.

  6. Perform Action on Object:

    • Endpoint: /OBJECT/OBJECTID/ACTION

    • Method: POST (ACTION)

    • Example: /todo/4/close

    • Description: Executes a specific action on an object.

  7. Delete Object:

    • Endpoint: /OBJECT/OBJECTID

    • Method: DELETE

    • Description: Deletes an object by its ID.

  8. Contract-Specific Operations:

    • Endpoint: /CONTRACTNO/OBJECT/OBJECTID

    • Description: Used for operations that require a contract number.

Key Points:

  • Contract Number: Always include the contract number in the URL for both new and old API endpoints.

  • Authentication: Use the access_token in the Authorization header with the Bearer scheme for all requests after authentication.

  • Method Naming: The EDIT method should ideally be named UPDATE for clarity, but it currently uses the POST method for updates.

This structure provides a clear and concise overview of how to interact with the Microbizz API, ensuring users understand the importance of the contract number and the correct use of access tokens for authentication.

Query commands

Query commands should contain three fields: type, fieldname and value

Greater

Return everything where fieldname is greater than value.

GreaterEqual

Return everything where fieldname is greater or equal than value.

Lesser

Return everything where fieldname is lesser than value.

LesserEqual

Return everything where fieldname is lesser or equal than value.

Like

Return everything where value is contained in fieldname.

Match

Return everything where fieldname equals value.

OneOf

Return everything where fieldname is one of value (value should be an array).

Logical commands

Logical commands contains a type and one or more conditions which are further query or logical commands.

AND

condition1, condition2

Return everything which satisfies both condition1 and condition2.

OR

condition1, condition2

Return everything which satisfies either condition1 or condition2.

NOT

condition

Return everything which doesn't satisfy condition.

Examples

Find all data where age is equal or greater than 18

{"type":"GreaterEqual","fieldname":"age","value":18}

Find all data where age is less than 40 and gender is male

{"type":"AND","condition1":{"type":"Lesser","fieldname":"age","value":40},"condition2":{"type":"Match","fieldname":"gender","value":"male"}}

Find all data where firstname contains the letter a

{"type":"Like","fieldname":"firstname","value":"a"}

Find all data changed since a specific time stamp

{"type":"Greater","fieldname":"change_date","value":"2021-01-15 14:45:00"}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.