Overview
The REST connector is the bridge between Venzia Datalinks and external data sources. Each datalink uses a REST connector to query external APIs and retrieve entity data for linking to Alfresco documents.Connector Configuration
The REST connector is defined within theconnectorRest object in your datalink JSON file:
Configuration Properties
URL Configuration
Full HTTP(S) URL of the REST API endpoint that handles search requests.The endpoint must:
- Accept GET requests with a query parameter
- Return a JSON array of entity objects
- Be accessible from the Alfresco server
http://localhost:3005/api/v1/public/employees/searchhttps://api.example.com/v2/departments/searchhttp://internal-api:8080/entities/find
The URL should point to a search endpoint, not a direct entity retrieval endpoint. Users will enter search terms in the Alfresco Share UI, and the connector will append them as query parameters.
Search Parameter
The query parameter name used to send the user’s search input to the API.Default: With
"query"Example: With searchParam: "query", user search for “John” becomes:searchParam: "search", the same search becomes:Authentication Configuration
Theauthentication object defines how the connector authenticates with the external API.
Authentication method used for API requests.Supported values:
"none"- No authentication (public API)"basic"- HTTP Basic Authentication
"basic"No Authentication
For public APIs that don’t require authentication:Even when
type is "none", the username and password fields may be present in configuration files but are ignored by the connector.Basic Authentication
For APIs requiring HTTP Basic Authentication:Username for Basic Authentication. Required when
type: "basic".Example: "user2019"Password for Basic Authentication. Required when
type: "basic".Example: "g3n3r4l"API Response Format
Expected Response Structure
The REST API must return a JSON array of objects. Each object represents one searchable entity:Response Requirements
JSON Array
Response must be a JSON array, even for single results
Matching Fields
Object properties must match column names in datalink configuration
Primary Key
Each object must include the primary key field defined in columns
Consistent Structure
All objects should have the same property structure
Complete Examples
Employee Datalink with Public API
Department Datalink with Basic Authentication
Request Flow
Here’s how a search request flows through the connector:User Enters Search
User types search text (e.g., “John”) in the Venzia Datalinks widget in Alfresco Share
Connector Builds Request
Venzia Datalinks constructs the HTTP request:
- Method: GET
- URL: Configured
url+?+searchParam+=+ user input - Headers: Authentication headers if configured
Display Results
Venzia Datalinks parses the response and displays matching entities according to column configuration
Security Best Practices
Use HTTPS
Always use HTTPS URLs for production APIs to encrypt credentials in transit
Restrict File Access
Set proper file permissions on JSON configuration files (chmod 600)
Network Security
Use firewall rules to restrict API access to Alfresco server IPs only
Credential Rotation
Regularly rotate API credentials and update configuration files
Testing REST Connectors
Manual Testing with curl
Test your API endpoint before configuring it in Venzia Datalinks:Verifying Response Format
Ensure the API response matches your column configuration:Example: Validating Employee API Response
Example: Validating Employee API Response
Your column configuration:Expected API response:Validation checklist:
- ✅ Response is JSON array
- ✅ Object contains
emp_nofield - ✅ Object contains
first_namefield - ✅ Object contains
last_namefield - ✅ Field names match exactly (case-sensitive)
Troubleshooting
Connection timeout or refused
Connection timeout or refused
Possible causes:
- API endpoint URL is incorrect
- API server is down or unreachable
- Network firewall blocking connection
- Wrong port number in URL
- Verify URL is accessible from Alfresco server
- Test with curl from the Alfresco server host
- Check firewall rules and network connectivity
401 Unauthorized error
401 Unauthorized error
Search returns empty results
Search returns empty results
Possible causes:
- Search parameter name doesn’t match API expectations
- API requires minimum search length
- API returns 200 but empty array for no matches
- Verify
searchParammatches API documentation - Test with known entities that exist in the system
- Check API documentation for search requirements
Malformed JSON response error
Malformed JSON response error
Possible causes:
- API returns HTML error page instead of JSON
- API returns single object instead of array
- Response contains invalid JSON syntax
- Verify API returns JSON array format
- Check API error handling for non-existent searches
- Test response with JSON validator
Advanced Configuration
Custom Headers
While not directly configurable in the current version, you can extend the connector to support custom headers by modifying the Java connector implementation.Timeout Configuration
Connection timeouts are configured at the system level:Proxy Configuration
If your Alfresco server requires a proxy to access external APIs:API Development Guidelines
If you’re developing a custom API for Venzia Datalinks integration:Return Arrays
Always return JSON arrays, even for single or zero results
Consistent Schema
Use consistent property names across all returned objects
Pagination
Return top 50-100 results by default for performance
Error Handling
Return empty arrays for no matches, not error responses
Recommended API Endpoint Pattern
Next Steps
Datalink JSON Schema
Learn about complete datalink configuration options
Content Models
Understand how to define Alfresco aspects
