OnOffice

Consume OnOffice API

Actions12

Overview

This node interacts with the OnOffice API to manage "Relation" resources, specifically supporting the "Get Many" operation. It retrieves multiple relation records that link estates and addresses (contacts) in the OnOffice system. This is useful when you want to fetch a list of relations with specific fields and apply filters, limits, or offsets to control the data returned.

Practical examples:

  • Fetching all relations of a certain type between estates and contacts.
  • Retrieving a paginated list of relations with custom filtering criteria.
  • Extracting only selected fields from relation records for reporting or further processing.

Properties

Name Meaning
Fields Comma-separated list of fields to return for each relation record (e.g., id,type,estateid)
Additional Fields Collection of optional parameters:
- Filter: JSON object defining filter criteria for the query.
- Limit: Maximum number of results to return (default 50).
- Offset: Number of results to skip before starting to collect the result set (default 0).

Output

The output is a JSON array where each item contains an object with the following structure:

  • success: Boolean indicating if the operation was successful.
  • resourceType: The resource involved, here always "relation".
  • operation: The operation performed, here "getMany".
  • data: An array of relation records matching the query, each containing the requested fields.
  • total (optional): Total count of matching records available (if provided by the API).

Example output snippet:

{
  "success": true,
  "resourceType": "relation",
  "operation": "getMany",
  "data": [
    {
      "id": "123",
      "type": "owner",
      "estateid": "456",
      "addressid": "789"
    },
    ...
  ],
  "total": 100
}

No binary data is output by this node.

Dependencies

  • Requires valid credentials for the OnOffice API, including an API token and secret.
  • The node makes HTTP POST requests to the OnOffice API endpoint at https://api.onoffice.de/api/stable/api.php.
  • Uses HMAC signature generation for request authentication.
  • Requires n8n credential configuration to provide the necessary API authentication tokens.

Troubleshooting

  • Invalid JSON in Filter: If the filter field is not valid JSON, the node throws an error "Filter must be a valid JSON". Ensure the filter input is correctly formatted JSON.
  • API Errors: If the OnOffice API returns an error, the node surfaces the message prefixed with "OnOffice API error:". Check the API credentials and the correctness of parameters.
  • Network Issues: Network errors are reported as "Network error: ...". Verify network connectivity and API endpoint accessibility.
  • Unsupported Operation or Resource: If an unsupported operation or resource is specified, the node throws an error indicating the unsupported combination.
  • Empty or Incorrect Fields: Providing invalid or empty fields may result in incomplete or no data returned. Use valid field names as per OnOffice API documentation.

Links and References

Discussion