Quickstart: Your First Call in 5 Minutes
In this tutorial, you'll make your first call to the SnackPrompt AI Engine API and receive semantic search results.
Prerequisites
Before you begin, you need:
A valid
tenant_id(See how to find it below)Data already ingested in the Knowledge Base (if you don't have any, follow the Ingesting Data tutorial first)
A tool to make HTTP requests (curl, Postman, Insomnia, etc.)
🔑 How to find your tenant_id
Your User ID is used as the tenant_id in all API requests.
In the platform dashboard, click on your profile avatar (bottom-left).
Click on "Copy my ID".
Use this value whenever the documentation asks for YOUR_TENANT_ID.
Step 1: Make a Semantic Search
Let's start with a simple search. Run the command below, replacing YOUR_TENANT_ID with your tenant_id:
curl -X POST https://api-integrations.snackprompt.com/v1/kb/search \
-H "Content-Type: application/json" \
-d '{
"query": "what are the available products?",
"filters": {
"tenant_id": "YOUR_TENANT_ID"
},
"limit": 5
}'Step 2: Understand the Response
If everything is correct, you'll receive a response like this:
What Each Field Means
items
List of results found
id
Unique identifier of the result in the vector database
score
Semantic similarity (0 to 1, higher is more relevant)
payload.original_text
The original document content
payload.snack_elemental_id
ID of the source elemental (document/table)
payload.tag_names
Tags associated with the content
total_found
Total number of results found
Step 3: Try the Chat
Now that you've seen how search works, try chat to get more elaborate answers:
The response will include an AI-generated answer based on your data:
Possible Errors
Error: tenant_id required
Solution: Make sure to include tenant_id inside the filters object.
Error: No results found
Solution: Check if you've already sent data to the Knowledge Base. Follow the Ingesting Data tutorial.
Next Steps
Now that you've made your first call, continue learning:
Ingesting Data - Learn how to send your own data
Semantic Search - Learn advanced search techniques
Chat with your Data - Explore all chat options
Estimated time: 5 minutes ✅
Last updated
Was this helpful?