REST API
Integrate with our REST API to build custom feedback solutions.
Base URL
https://yoursite.com/api/
Authentication
All API requests require authentication using your project's API key:
Authorization: Bearer YOUR_API_KEY
Get your API key: Find your API key in your project settings in the dashboard.
Submit Feedback
Submit feedback, bug reports, or reviews programmatically.
/api/feedback/submit
Request Body
{
"type": "feedback", // "feedback" | "bug" | "review"
"title": "Feature request",
"description": "Would love to see dark mode",
"email": "user@example.com", // optional
"metadata": { // optional
"url": "https://example.com/page",
"userAgent": "Mozilla/5.0...",
"timestamp": "2024-01-15T10:30:00Z"
}
}
Response
{
"success": true,
"id": "feedback_123",
"message": "Feedback submitted successfully"
}
Get Feedback
Retrieve feedback for your project.
/api/feedback?projectId=YOUR_PROJECT_ID
Query Parameters
Parameter | Type | Description |
---|---|---|
projectId | string | Your project ID (required) |
type | string | Filter by type: feedback, bug, review |
limit | number | Number of items to return (max 100) |
offset | number | Pagination offset |
Response
{
"data": [
{
"id": "feedback_123",
"type": "feedback",
"title": "Feature request",
"description": "Would love to see dark mode",
"email": "user@example.com",
"created_at": "2024-01-15T10:30:00Z",
"metadata": {
"url": "https://example.com/page",
"userAgent": "Mozilla/5.0..."
}
}
],
"total": 1,
"limit": 50,
"offset": 0
}
Error Responses
All errors follow this format:
{
"success": false,
"error": "INVALID_PROJECT_ID",
"message": "The provided project ID is invalid"
}
Common Error Codes
Status | Code | Description |
---|---|---|
400 | VALIDATION_ERROR | Request validation failed |
401 | UNAUTHORIZED | Invalid or missing API key |
404 | INVALID_PROJECT_ID | Project not found |
429 | RATE_LIMITED | Too many requests |
Rate Limits
Rate Limits: API requests are limited to 1000 requests per hour per API key.
SDKs
We provide official SDKs for popular languages:
- JavaScript/Node.js:
npm install feedbackwidget-js
- Python:
pip install feedbackwidget-python
- PHP:
composer require feedbackwidget/php-sdk