Integrations
Uhuu enables integration with external data sources, allowing templates to fetch remote data during document creation. This is achieved by configuring a service URL and binding the integration to specific templates. Here’s how the integration process works:
Create a New Integration
Go to the Integrations tab and create a new integration. Provide a name for the integration, which will be used to identify it within the Uhuu platform.
Configure the API Request
In the Request section of the integration setup:
- Specify the API URL of the external data source.
- Define any dynamic parameters within the URL using curly braces (e.g.,
{{id}}
). These parameters will be replaced with user-provided values during document creation. - Choose the HTTP method (e.g., GET, POST) for the request.
For example, you might configure a URL like:
https://example.com/api/v1/data/{{id}}
where {{id}}
is a dynamic parameter that will be replaced by the user’s input.
Bind the Integration to a Template
In the template settings, go to the Integration tab:
- Select the integration you created.
- Set the Bind to property, which specifies where the fetched data will be stored within the template payload.
For example, if you bind the integration to listing
, the fetched data will be accessible under listing
in the template’s payload.
Provide User Input and Fetch Data
When generating a document, the user will be prompted to enter values for any required dynamic parameters (e.g., the id
for fetching specific data). After entering this information and creating the document, Uhuu will:
- Replace the dynamic parameters in the URL with the provided values.
- Fetch data from the external source.
- Bind the response data to the specified property in the template’s payload.
Example Integration Workflow
API URL Setup:
https://example.com/api/v1/listings/
User Input:
{"id": "123"}
(entered at document creation)Resolved URL:
https://example.com/api/v1/listings/123
Bound Data: If the bind property is set to
listing
, the response will populate underlisting
in the payload:json{ "id": "123", "listing": { "title": "Sample Listing", "description": "A detailed listing description...", "images": [...], ... } }
This integration setup makes it easy to pull in external data dynamically, enhancing the document creation experience by using real-time data.