Actions28
Overview
The node interacts with the Dolibarr API to list contracts stored in a Dolibarr system. It allows users to retrieve multiple contract records with flexible filtering, sorting, and pagination options. This is useful for automating workflows that require contract data extraction, such as reporting, synchronization with other systems, or triggering actions based on contract attributes.
Typical use cases include:
- Fetching all contracts related to specific third parties.
- Retrieving contracts sorted by creation date or ID.
- Paginating through large sets of contracts to process them in batches.
- Applying custom SQL-like filters to narrow down contract results.
Properties
Name | Meaning |
---|---|
Sort Field | The database field by which to sort the returned contracts (e.g., t.rowid ). |
Sort Order | The order of sorting: either ascending (ASC ) or descending (DESC ). |
Limit | Maximum number of contract records to return per request. |
Page | The page number to query, used for pagination (starting from 0). |
Get All | Whether to return all matching contracts ignoring the limit, or only up to the specified limit. |
Thirdparty IDs | Comma-separated list of third party IDs to filter contracts by (e.g., "1" or "1,2,3" ). |
SQL Filters | Additional SQL-like criteria to filter contracts, e.g., (t.label:like:'%dol%') and (t.datec>...) |
Output
The output contains JSON data representing the list of contracts retrieved from Dolibarr according to the specified filters and pagination. Each item in the output corresponds to a contract record with its fields as provided by the Dolibarr API.
If the node supports binary data output (not explicitly shown here), it would typically represent attachments or documents related to contracts, but this is not indicated in the provided code or properties.
Dependencies
- Requires an active connection to a Dolibarr instance via its REST API.
- Needs an API authentication token or key configured in n8n credentials to authorize requests.
- The base URL of the Dolibarr API must be set in the credentials configuration.
- Uses the Dolibarr API endpoint
/api/index.php
for requests.
Troubleshooting
Common issues:
- Incorrect API base URL or missing/invalid API credentials will cause authentication failures.
- Using invalid or malformed SQL filters may result in API errors or empty results.
- Requesting pages beyond available data may return empty responses.
- Specifying non-existent third party IDs will yield no contracts.
Error messages:
- Authentication errors usually indicate misconfigured credentials; verify API keys and URLs.
- HTTP 404 errors when searching third parties or users suggest the queried entity does not exist.
- Syntax errors in SQL filters can cause the API to reject the request; ensure correct syntax.
Links and References
- Dolibarr API Documentation — Official documentation for Dolibarr REST API endpoints and usage.
- n8n Documentation — General guidance on creating and using custom nodes in n8n.