Complete Guide to Feedlooply API Integration
Yesp Developer Team
Yesp Studio
Unlock the Power of Feedlooply API
The Feedlooply API, built on Yesp Tech infrastructure, provides developers with comprehensive access to form management, data clustering, and workflow automation capabilities. This guide covers everything you need to integrate Feedlooply into your applications and business processes.
API Overview and Architecture
The Feedlooply API follows RESTful principles and integrates seamlessly with the broader Yesp Studio ecosystem:
Core API Features
- RESTful API design with JSON responses
- OAuth 2.0 authentication and authorization
- Rate limiting and request throttling
- Comprehensive error handling and status codes
- Real-time webhooks for event notifications
API Endpoints Structure
- Forms API: Create, update, and manage forms
- Responses API: Collect and retrieve form responses
- Clustering API: Access AI-powered data insights
- Webhooks API: Configure real-time notifications
- Analytics API: Retrieve performance metrics
Getting Started with Authentication
Secure API access through Yesp Studio authentication:
API Key Generation
// Generate API key in Yesp Studio dashboard
const apiKey = 'yesp_live_...' // Your API key
const baseURL = 'https://api.feedlooply.com/v1'
// Authentication header
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
OAuth 2.0 Flow
// OAuth 2.0 authentication for user-specific access
const authURL = 'https://auth.yespstudio.com/oauth/authorize'
const tokenURL = 'https://auth.yespstudio.com/oauth/token'
// Redirect user to authorization URL
const authParams = {
client_id: 'your_client_id',
response_type: 'code',
scope: 'feedlooply:read feedlooply:write',
redirect_uri: 'https://yourapp.com/callback'
}
Forms Management API
Create and manage forms programmatically:
Creating a New Form
// POST /forms
const createForm = async (formData) => {
const response = await fetch(`${baseURL}/forms`, {
method: 'POST',
headers,
body: JSON.stringify({
title: 'Customer Feedback Form',
description: 'Collect customer feedback and suggestions',
fields: [
{
type: 'text',
name: 'customer_name',
label: 'Your Name',
required: true
},
{
type: 'email',
name: 'email',
label: 'Email Address',
required: true
},
{
type: 'textarea',
name: 'feedback',
label: 'Your Feedback',
required: true
}
],
settings: {
enable_clustering: true,
auto_response: true
}
})
})
return response.json()
}
Updating Form Configuration
// PUT /forms/{form_id}
const updateForm = async (formId, updates) => {
const response = await fetch(`${baseURL}/forms/${formId}`, {
method: 'PUT',
headers,
body: JSON.stringify(updates)
})
return response.json()
}
Response Collection and Management
Handle form responses and data collection:
Retrieving Form Responses
// GET /forms/{form_id}/responses
const getResponses = async (formId, options = {}) => {
const params = new URLSearchParams({
page: options.page || 1,
limit: options.limit || 50,
sort: options.sort || 'created_at',
order: options.order || 'desc'
})
const response = await fetch(`${baseURL}/forms/${formId}/responses?${params}`, {
headers
})
return response.json()
}
Submitting Responses Programmatically
// POST /forms/{form_id}/responses
const submitResponse = async (formId, responseData) => {
const response = await fetch(`${baseURL}/forms/${formId}/responses`, {
method: 'POST',
headers,
body: JSON.stringify({
responses: responseData,
metadata: {
source: 'api',
user_agent: 'Custom Integration',
ip_address: '192.168.1.1'
}
})
})
return response.json()
}
AI Clustering API
Access Feedlooply's powerful AI clustering insights:
Getting Cluster Analysis
// GET /forms/{form_id}/clusters
const getClusters = async (formId) => {
const response = await fetch(`${baseURL}/forms/${formId}/clusters`, {
headers
})
const data = await response.json()
// Example response structure
/*
{
"clusters": [
{
"id": "cluster_1",
"name": "Positive Feedback",
"size": 45,
"confidence": 0.92,
"keywords": ["excellent", "great", "satisfied"],
"responses": [...],
"insights": {
"sentiment": "positive",
"priority": "low",
"action_items": []
}
}
],
"summary": {
"total_responses": 150,
"clusters_found": 5,
"processing_time": "2.3s"
}
}
*/
return data
}
Custom Clustering Parameters
// POST /forms/{form_id}/clusters/analyze
const customClustering = async (formId, parameters) => {
const response = await fetch(`${baseURL}/forms/${formId}/clusters/analyze`, {
method: 'POST',
headers,
body: JSON.stringify({
algorithm: 'kmeans', // or 'hierarchical', 'dbscan'
num_clusters: parameters.numClusters || 'auto',
fields: parameters.fields || ['all'],
filters: parameters.filters || {},
options: {
min_cluster_size: 5,
similarity_threshold: 0.8
}
})
})
return response.json()
}
Webhooks and Real-Time Events
Configure webhooks for real-time notifications:
Setting Up Webhooks
// POST /webhooks
const createWebhook = async (webhookConfig) => {
const response = await fetch(`${baseURL}/webhooks`, {
method: 'POST',
headers,
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/feedlooply',
events: [
'form.response.created',
'form.cluster.updated',
'form.analytics.daily'
],
secret: 'your_webhook_secret',
active: true
})
})
return response.json()
}
Handling Webhook Events
// Express.js webhook handler example
app.post('/webhooks/feedlooply', (req, res) => {
const signature = req.headers['x-feedlooply-signature']
const payload = req.body
// Verify webhook signature
const expectedSignature = crypto
.createHmac('sha256', webhookSecret)
.update(JSON.stringify(payload))
.digest('hex')
if (signature !== `sha256=${expectedSignature}`) {
return res.status(401).send('Invalid signature')
}
// Process webhook event
switch (payload.event) {
case 'form.response.created':
handleNewResponse(payload.data)
break
case 'form.cluster.updated':
handleClusterUpdate(payload.data)
break
default:
console.log('Unknown event:', payload.event)
}
res.status(200).send('OK')
})
Analytics and Reporting API
Access comprehensive analytics data:
Form Performance Metrics
// GET /forms/{form_id}/analytics
const getAnalytics = async (formId, timeRange) => {
const params = new URLSearchParams({
start_date: timeRange.start,
end_date: timeRange.end,
metrics: 'views,responses,conversion_rate,completion_time'
})
const response = await fetch(`${baseURL}/forms/${formId}/analytics?${params}`, {
headers
})
return response.json()
}
Integration with Yesp Studio Ecosystem
Leverage Feedlooply within the broader Yesp Studio platform:
Cross-Platform Data Sharing
// Access unified data across Yesp Studio tools
const getUnifiedData = async (customerId) => {
const response = await fetch(`${baseURL}/customers/${customerId}/unified-data`, {
headers: {
...headers,
'X-Yesp-Platform': 'unified'
}
})
// Returns data from Feedlooply, CRM, Marketing, etc.
return response.json()
}
Error Handling and Best Practices
Implement robust error handling:
Error Response Structure
// Standard error response format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid form field configuration",
"details": {
"field": "email",
"issue": "Invalid email validation pattern"
},
"request_id": "req_123456789"
}
}
Rate Limiting and Retry Logic
const apiCall = async (url, options, retries = 3) => {
try {
const response = await fetch(url, options)
if (response.status === 429) {
// Rate limited - wait and retry
const retryAfter = response.headers.get('Retry-After') || 60
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000))
if (retries > 0) {
return apiCall(url, options, retries - 1)
}
}
if (!response.ok) {
throw new Error(`API Error: ${response.status}`)
}
return response.json()
} catch (error) {
console.error('API call failed:', error)
throw error
}
}
SDK and Libraries
Feedlooply provides official SDKs for popular languages:
JavaScript/Node.js SDK
npm install @feedlooply/sdk
// Usage example
import { FeedlooplyClient } from '@feedlooply/sdk'
const client = new FeedlooplyClient({
apiKey: 'your_api_key',
environment: 'production' // or 'sandbox'
})
const form = await client.forms.create({
title: 'My Form',
fields: [...]
})
Testing and Development
Use Feedlooply's sandbox environment for development:
Sandbox Configuration
// Sandbox API endpoint
const sandboxURL = 'https://api-sandbox.feedlooply.com/v1'
// Test API key (sandbox)
const testApiKey = 'yesp_test_...'
// All API calls work the same in sandbox
// Data is isolated and can be safely tested
Advanced Integration Patterns
Implement sophisticated integration patterns:
Bulk Operations
// Batch create multiple forms
const batchCreateForms = async (formsData) => {
const response = await fetch(`${baseURL}/forms/batch`, {
method: 'POST',
headers,
body: JSON.stringify({
forms: formsData,
options: {
fail_on_error: false,
return_details: true
}
})
})
return response.json()
}
Real-Time Data Streaming
// WebSocket connection for real-time updates
const ws = new WebSocket('wss://stream.feedlooply.com/v1/forms/123/responses')
ws.onmessage = (event) => {
const data = JSON.parse(event.data)
console.log('New response:', data)
// Process real-time response
handleRealTimeResponse(data)
}
Performance Optimization
Optimize your Feedlooply API integration:
Caching Strategies
// Implement intelligent caching
const cache = new Map()
const getCachedData = async (key, fetchFunction, ttl = 300000) => {
const cached = cache.get(key)
if (cached && Date.now() - cached.timestamp < ttl) {
return cached.data
}
const data = await fetchFunction()
cache.set(key, { data, timestamp: Date.now() })
return data
}
Security Best Practices
Ensure secure API integration:
API Key Management
- Store API keys securely in environment variables
- Use different keys for different environments
- Rotate API keys regularly
- Monitor API key usage and access patterns
Data Validation
// Validate data before sending to API
const validateFormData = (formData) => {
const schema = {
title: { type: 'string', required: true, maxLength: 255 },
fields: { type: 'array', required: true, minItems: 1 }
}
// Implement validation logic
return isValid(formData, schema)
}
Monitoring and Debugging
Monitor your API integration effectively:
Request Logging
// Log all API requests for debugging
const loggedFetch = async (url, options) => {
const startTime = Date.now()
console.log('API Request:', {
url,
method: options.method || 'GET',
timestamp: new Date().toISOString()
})
try {
const response = await fetch(url, options)
const duration = Date.now() - startTime
console.log('API Response:', {
status: response.status,
duration: `${duration}ms`,
headers: Object.fromEntries(response.headers.entries())
})
return response
} catch (error) {
console.error('API Error:', error)
throw error
}
}
Get Started with Feedlooply API
Ready to integrate Feedlooply's powerful API into your applications? Join the beta program through Yesp Studio to access comprehensive API documentation, SDKs, and developer support. Experience how Yesp Corporation's API-first approach can transform your business automation and data processing capabilities.