Actions12
Overview
This node interacts with the OnOffice API to manage "Relation" resources, specifically supporting the "Get Many" operation in this context. It retrieves multiple relation records that link estates and addresses (contacts) within the OnOffice system. This is useful when you want to fetch a list of relations with specific fields and optional filtering, pagination, or offsetting.
Practical examples include:
- Retrieving all relations of a certain type between estates and contacts.
- Fetching relations with specific fields such as relation ID, type, estate ID, and address ID.
- Applying filters to get only relations matching certain criteria.
- Paginating through large sets of relation data by specifying limits and offsets.
Properties
Name | Meaning |
---|---|
Fields | Comma-separated list of fields to return for each relation record (e.g., id,type,estateid,addressid ). |
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 request 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 record includes the requested fields such asid
,type
,estateid
, andaddressid
.total
(optional): Total count of matching records available (if provided by the API).
No binary data is output by this node.
Example output snippet:
{
"success": true,
"resourceType": "relation",
"operation": "getMany",
"data": [
{
"id": "123",
"type": "owner",
"estateid": "456",
"addressid": "789"
},
...
],
"total": 100
}
Dependencies
- Requires valid credentials for the OnOffice API, including an API token and secret.
- The node uses HMAC signature authentication for requests.
- No additional external dependencies beyond the OnOffice API and n8n's HTTP request helper.
Troubleshooting
- Invalid JSON in Filter: If the filter field contains invalid JSON, the node throws an error stating "Filter must be a valid JSON". Ensure the filter input is correctly formatted JSON.
- API Authentication Errors: If the API token or secret are incorrect or missing, the node will fail with an authentication error from the OnOffice API.
- Network Issues: Network errors during the HTTP request will cause the node to throw a network error message.
- Unsupported Operation or Resource: If an unsupported operation or resource is selected, the node throws an error indicating the unsupported combination.
- Empty or Incorrect Fields: Specifying fields that do not exist may result in incomplete or empty data arrays.
To resolve these issues:
- Validate JSON inputs carefully.
- Verify API credentials are correct and have necessary permissions.
- Check network connectivity.
- Use supported operations and resources as per the node's configuration.
Links and References
- OnOffice API Documentation (official API docs for further details on endpoints and data structures)
- n8n documentation on Creating Custom Nodes