OnOffice

Consume OnOffice API

Actions12

Overview

This node integrates with the OnOffice API to manage real estate-related data, specifically estates, addresses, and relations. The "Address" resource's "Update" operation allows users to update existing address records in the OnOffice system by specifying the record ID and the new data.

Common scenarios include:

  • Updating contact information or location details of an address linked to a real estate object.
  • Correcting or enriching address data after initial creation.
  • Synchronizing address updates from other systems into OnOffice.

Practical example:

  • A user wants to update the email and phone number of a contact address associated with a property. They provide the address ID and a JSON object containing the updated fields. The node sends this update to OnOffice and returns the result.

Properties

Name Meaning
ID The unique identifier of the address record to update. This is required to specify which address to modify.
Data A JSON object containing the fields and values to update for the address. Must be valid JSON representing the new data for the address record.

Output

The node outputs a JSON object with the following structure:

  • success: Boolean indicating if the update was successful.
  • resourceType: The resource type, here always "address".
  • operation: The operation performed, here "update".
  • data: Contains the updated address data returned from the API (if available).
  • message: A status message from the API about the update operation.

Example output JSON:

{
  "success": true,
  "resourceType": "address",
  "operation": "update",
  "data": { /* updated address record data */ },
  "message": "Record updated successfully"
}

No binary data output is produced by this node.

Dependencies

  • Requires an API token and secret for authenticating with the OnOffice API.
  • The node uses HTTP POST requests to the OnOffice stable API endpoint (https://api.onoffice.de/api/stable/api.php).
  • The node depends on helper functions to generate request IDs, format fields, and create HMAC signatures for secure API calls.
  • Proper credentials must be configured in n8n to allow authenticated access.

Troubleshooting

  • Invalid JSON in Data: If the "Data" property contains invalid JSON, the node throws an error stating "Data must be a valid JSON". Ensure the JSON syntax is correct.
  • Missing or Incorrect ID: The "ID" field is required. Omitting it or providing an incorrect ID will cause the API call to fail.
  • API Errors: If the OnOffice API returns an error, the node surfaces the message, e.g., "OnOffice API error: ". Check the API token, secret, and permissions.
  • Network Issues: Network errors are reported as "Network error: ". Verify network connectivity and API endpoint accessibility.
  • Unsupported Operation or Resource: The node validates that the resource and operation are supported; otherwise, it throws descriptive errors.
  • Filter Parsing Errors: Although not relevant for update, other operations using filters require valid JSON; invalid filters cause errors.

To resolve issues:

  • Validate all JSON inputs before running the node.
  • Confirm credentials and API access rights.
  • Check the correctness of the ID used.
  • Review API response messages for specific problems.

Links and References

Discussion