OnOffice icon

OnOffice

Consume OnOffice API

Actions15

Overview

This node integrates with the OnOffice API to manage and retrieve real estate-related data. Specifically, for the Address resource with the Get Many operation, it fetches multiple address records (contacts) from the OnOffice system based on various filter criteria and pagination options.

Typical use cases include:

  • Retrieving a list of contacts filtered by first name, last name, email, phone number, or city.
  • Fetching specific fields of contact information such as customer number, name, email, phone numbers, and address details.
  • Using advanced filters to perform complex queries on the address data.
  • Paginating through large sets of contacts using limit and offset parameters.

Practical example:

  • A real estate agency wants to export all contacts located in a particular city who have a certain phone number pattern, retrieving only their names, emails, and phone numbers for a marketing campaign.

Properties

Name Meaning
Fields Select which fields of the address records to return. Options include Customer Number, Form of Address, First Name, Last Name, Email, Phone 1, Phone 2, Mobile, Street, Postal Code, City, Country, User, Creation Date, Last Change Date. Default includes common contact info fields.
Filter by First Name Filter results to addresses matching this first name exactly.
Filter by Last Name Filter results to addresses matching this last name exactly.
Filter by Email Filter results to addresses matching this email exactly.
Filter by Phone (Partial Match) Filter results to addresses where the phone number partially matches this string.
Filter by City Filter results to addresses located in this city.
Advanced Filter Provide advanced filter criteria as a JSON string; these criteria are merged with other filters.
Limit Maximum number of address records to return. Default is 50.
Offset Number of records to skip before starting to collect the result set. Default is 0.

Output

The output is a JSON array containing the retrieved address records with the requested fields. The structure includes:

  • success: Boolean indicating if the request was successful.
  • resourceType: Always "address" for this operation.
  • operation: Always "getMany" for this operation.
  • data: An array of address objects, each containing the selected fields.
  • total (optional): Total number of matching records available (if provided by the API).
  • status or message: Status messages from the API response.

Example output snippet:

{
  "success": true,
  "resourceType": "address",
  "operation": "getMany",
  "data": [
    {
      "KdNr": "12345",
      "Anrede": "Herr",
      "Vorname": "Max",
      "Name": "Mustermann",
      "Email": "max.mustermann@example.com",
      "Telefon1": "+49 123 456789",
      "Strasse": "Musterstraße",
      "Plz": "12345",
      "Ort": "Musterstadt"
    },
    ...
  ],
  "total": 150,
  "status": {...}
}

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the OnOffice API.
  • Needs an API token and secret configured as credentials in n8n for authentication.
  • Uses HMAC signature generation for secure API requests.
  • The base URL for the API is https://api.onoffice.de/api/latest/api.php.

Troubleshooting

  • Invalid JSON in Data Field: If you provide JSON data for create/update operations, ensure it is valid JSON. Otherwise, the node throws an error indicating invalid JSON.
  • API Request Failed: Network issues, incorrect credentials, or API downtime can cause request failures. Check your API token and secret, network connectivity, and OnOffice service status.
  • Unsupported Resource or Operation: Selecting a resource or operation not supported by the node will throw an error. Verify that "Address" resource and "Get Many" operation are selected.
  • Empty Results: If no records match the filters, the returned data array will be empty. Adjust filters or increase the limit.
  • Partial Phone Number Filter: The phone filter uses partial matching with wildcards; ensure the input string is correct to get expected results.

Links and References

Discussion