OnOffice icon

OnOffice

Consume OnOffice API

Actions15

Overview

This node integrates with the OnOffice API to manage relations between estates and addresses (contacts). Specifically, the "Relation - Create" operation allows users to establish a new relationship linking an estate with an address under a defined relation type such as Owner, Tenant, Interested Party, or Contact.

Common scenarios where this node is beneficial include real estate management workflows where you need to programmatically associate properties (estates) with people or entities (addresses/contacts) in different roles. For example, automatically linking a newly created property listing with its owner or tenant contact information.

Practical example:

  • After creating a new estate record, use this node to create a relation marking a specific contact as the owner of that estate.
  • Link multiple tenants to a rental property by creating several relations with the "Tenant" relation type.

Properties

Name Meaning
Relation Type Type of relation between estate and address. Options: Owner, Tenant, Interested Party, Contact
Estate ID ID of the estate for which the relation is being created (required)
Address ID ID of the address (contact) involved in the relation (required)

Output

The output JSON contains the result of the create relation API call with the following structure:

  • success: Boolean indicating if the creation was successful.
  • resourceType: The resource affected, here always "relation".
  • operation: The operation performed, here "create".
  • data: Object containing details of the created relation.
  • message: Optional message from the API response, e.g., confirmation text.

Additionally, debug information including the raw API response and request sent is included under a debug field for troubleshooting purposes.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the OnOffice API using valid API credentials (an API token and secret).
  • The node uses HTTP POST requests to the OnOffice API endpoint at https://api.onoffice.de/api/latest/api.php.
  • Proper configuration of the API credentials within n8n is necessary before using this node.

Troubleshooting

  • Invalid JSON Data: If the input data for other operations (not relevant here but present in the node) is malformed, the node throws an error indicating invalid JSON. For relation creation, ensure the Estate ID and Address ID are valid strings.
  • API Request Failed: Network issues or incorrect credentials can cause the API request to fail. Check your API token and secret, and verify network connectivity.
  • API Action Error: If the API returns an error code, the node surfaces the error message. Common causes include invalid IDs or relation types not recognized by the API.
  • Unsupported Resource or Operation: Using unsupported combinations will throw errors. Ensure the resource is set to "relation" and operation to "create" for this functionality.

If the node is set to continue on failure, it will output error details instead of stopping execution.

Links and References


This summary focuses exclusively on the "Relation - Create" operation of the OnOffice node based on the provided source code and property definitions.

Discussion