How to Integrate with Make

Learn how to use the SnackPrompt AI Engine API to build powerful automations and AI-powered scenarios in Make (formerly Integromat).

Overview

Make offers several ways to integrate external APIs into your automations:

Method
Use Case
Description

HTTP Module

Direct API calls

Make HTTP requests to any API

Webhooks

Receive data

Trigger scenarios when external events occur

JSON Module

Data processing

Parse and create JSON structures

OpenAI/AI Modules

AI integration

Combine with AI models for intelligent workflows

Integration Architecture

┌─────────────────────────────────────────────────────────┐
│                        Make                             │
│  ┌─────────────┐    ┌─────────────┐    ┌────────────┐   │
│  │   Trigger   │───▶│ HTTP Module │───▶│   Action  │   │
│  └─────────────┘    └──────┬──────┘    └────────────┘   │
│                            │                            │
│                     ┌──────▼──────┐                     │
│                     │    Router   │                     │
│                     │ (optional)  │                     │
│                     └──────┬──────┘                     │
└────────────────────────────┼────────────────────────────┘


              ┌──────────────────────────────┐
              │  SnackPrompt AI Engine API   │
              │  /v1/kb/search or /v1/kb/chat│
              └──────────────────────────────┘

Use the HTTP > Make a request module to call the SnackPrompt AI Engine API directly.

Step 1: Create a New Scenario

  1. Go to make.comarrow-up-right and click Create a new scenario

  2. Choose your trigger module (e.g., Webhook, Email, Schedule)

Step 2: Add HTTP Module

  1. Click + to add a new module

  2. Search for HTTP

  3. Select Make a request

Step 3: Configure the Request

For Search Endpoint:

Field
Value

URL

https://api-integrations.snackprompt.com/v1/kb/search

Method

POST

Body type

Raw

Content type

JSON (application/json)

Headers:

Name
Value

x-api-key

YOUR_API_KEY

Request content (JSON):

Replace {{1.query}} with the appropriate variable from your trigger module.

Step 4: Parse the Response

Check Parse response to automatically parse the JSON response into usable variables.

Step 5: Use the Results

The API returns a list of relevant documents in items[]. You can use them in subsequent modules:

  • {{2.items[].payload.original_text}} - The document content

  • {{2.items[].score}} - Relevance score

  • {{2.items[].payload.snack_item_id}} - Document ID


Method 2: Webhooks (Receive Requests)

Use when you want to receive requests and respond with knowledge base information.

Step 1: Create Webhook Trigger

  1. Create a new scenario

  2. Add Webhooks > Custom webhook as the trigger

  3. Click Add to create a new webhook

  4. Copy the webhook URL provided

Step 2: Add HTTP Module

Configure as shown in Method 1, using the webhook data:

Request content:

Step 3: Return Response

Add Webhooks > Webhook response module at the end:

Field
Value

Status

200

Body

{{2.body}} or formatted response

Custom headers

Content-Type: application/json


Method 3: Chat Endpoint for Complete Responses

Use the /v1/kb/chat endpoint when you want the API to handle all the RAG and return a ready response.

Configuration

Field
Value

URL

https://api-integrations.snackprompt.com/v1/kb/chat

Method

POST

Body type

Raw

Content type

JSON (application/json)

Headers:

Name
Value

x-api-key

YOUR_API_KEY

Request content:

Response

The API returns:

  • answer: AI-generated response ready to use

  • sources: Sources used to generate the response

Access with {{2.answer}} and {{2.sources}}.


Method 4: With AI Modules (RAG Pipeline)

Combine the search API with Make's AI modules for custom RAG workflows.

RAG Scenario Structure

Step 1: Search for Context

Use HTTP module to call /v1/kb/search as shown in Method 1.

Step 2: Format Context with Iterator + Aggregator

Add Iterator module:

  • Array: {{2.items}}

Add Text Aggregator module:

  • Source module: Iterator

  • Text: [{{3.i}}] {{3.payload.original_text}}

  • Row separator: \n\n

Step 3: Generate Response with OpenAI

Add OpenAI > Create a Completion module:

Field
Value

Model

gpt-4 or gpt-3.5-turbo

Messages

System + User messages

System Message:

User Message:


Practical Use Cases

1. Support Chatbot

Simple chatbot that answers questions using your knowledge base.

2. Email Auto-Responder

Automatically respond to customer emails with relevant information.

3. Slack Integration

Answer questions posted in a Slack channel.

4. Multi-Source RAG with Router

Route queries to different knowledge bases based on topic.

5. Scheduled Knowledge Digest

Generate weekly reports from your knowledge base.

6. Form Response with Fallback


Configuration Tips

1. Store Credentials Securely

Use Make's Connections or Data Stores for API keys:

  1. Go to Connections in the left menu

  2. Create a new HTTP Basic Auth or API Key connection

  3. Use the connection in your HTTP modules

2. Use Variables and Data Stores

Store tenant_id and other config in a Data Store:

3. Handle Errors with Error Handler

Right-click the HTTP module and add an Error Handler:

4. Limit Results for Efficiency

Start with fewer results:

5. Use Filters for Context

Direct searches with tags:

6. Enable Parse Response

Always check Parse response in the HTTP module to easily access response fields.


Complete Example: Customer Support Automation

Scenario Overview

  1. Customer submits question via form

  2. Scenario searches knowledge base

  3. If answer found, sends automated reply

  4. If not found, creates support ticket

Step-by-Step Setup

Module 1: Typeform - Watch Responses

  • Connection: Your Typeform account

  • Form: Select your support form

Module 2: HTTP - Make a request

  • URL: https://api-integrations.snackprompt.com/v1/kb/chat

  • Method: POST

  • Headers: x-api-key: YOUR_API_KEY

  • Body type: Raw

  • Content type: JSON (application/json)

  • Request content:

  • Parse response: Yes

Module 3: Router

  • Route 1: {{length(2.sources)}} > 0 (has results)

  • Route 2: {{length(2.sources)}} = 0 (no results)

Module 4A: Gmail - Send an Email (Route 1)

  • To: {{1.answers[email].email}}

  • Subject: Re: Your question

  • Content: {{2.answer}}

Module 4B: Zendesk - Create Ticket (Route 2)

  • Subject: Support Request: {{1.answers[subject].text}}

  • Description: {{1.answers[question].text}}


Working with Arrays

Iterating Over Results

Use Iterator to process each result:

Inside the iterator, access:

  • {{3.payload.original_text}}

  • {{3.score}}

  • {{3.payload.snack_item_id}}

Aggregating Results

Use Text Aggregator to combine results:

Field
Value

Source module

Iterator

Text

- {{3.payload.original_text}}

Row separator

\n

Result: A formatted list of all documents.

Array Functions

Useful functions for working with results:

Function
Example
Description

first()

{{first(2.items)}}

Get first result

last()

{{last(2.items)}}

Get last result

length()

{{length(2.items)}}

Count results

slice()

{{slice(2.items; 0; 3)}}

Get first 3 results


Troubleshooting

Error: "tenant_id is required"

Make sure tenant_id is inside the filters object:

Error: "Invalid JSON"

  1. Verify JSON syntax in the request content

  2. Check for unescaped special characters in variables

  3. Use the JSON > Create JSON module to build complex payloads safely

Empty Response / No Items

  1. Verify your tenant_id is correct

  2. Check if the query matches content in your knowledge base

  3. Remove tag_names filter to search all content

  4. Increase the limit parameter

Cannot Access Response Fields

  1. Ensure Parse response is checked

  2. Verify the response structure by checking execution history

  3. Use {{2.body}} to see the raw response

Rate Limiting (429 Error)

  1. Add a Sleep module between API calls

  2. Use Make's built-in Rate limiting in scenario settings

  3. Consider using Queue for high-volume scenarios

Timeout Errors

  1. Increase the Timeout setting in the HTTP module

  2. Check if your query is too complex

  3. Reduce the limit parameter


Advanced Patterns

Caching with Data Stores

Cache frequent queries to reduce API calls:

Retry Pattern

Automatic retry on failure:

Batch Processing

Process multiple queries efficiently:


External Resources

Last updated

Was this helpful?