API de Envios
Create and retrieve feedback submissions programmatically.
List Envios
GET /api/v2/submissions
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per_page | integer | Items per page (default: 15, max: 100) |
status | string | Filter by status: pending, approved, resolved, spam |
campaign_id | integer | Filter by campaign ID |
product_id | integer | Filter by product ID |
from | date | Start date (YYYY-MM-DD) |
to | date | End date (YYYY-MM-DD) |
Example
curl "https://yourdomain.com/api/v2/submissions?status=approved&per_page=10" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"data": [
{
"id": 42,
"campaign_id": 1,
"product_id": 1,
"star_rating": 5,
"nps_score": 9,
"text_feedback": "Absolutely love this product!",
"customer_name": "Jane Doe",
"customer_email": "[email protected]",
"sentiment_score": 0.92,
"sentiment_label": "positive",
"status": "approved",
"is_public": true,
"admin_reply": "Thank you, Jane! We're glad you love it.",
"created_at": "2024-03-15T10:30:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 10,
"total": 42
}
}
Get Single Submission
GET /api/v2/submissions/{id}
Example
curl "https://yourdomain.com/api/v2/submissions/42" \
-H "Authorization: Bearer YOUR_API_KEY"
Create Submission
POST /api/v2/submissions
Request Body
{
"campaign_id": 1,
"star_rating": 5,
"nps_score": 9,
"text_feedback": "Great product, very intuitive!",
"customer_name": "John Smith",
"customer_email": "[email protected]"
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
campaign_id | integer | Yes | Campaign to submit to |
star_rating | integer | No | 1-5 calificacion por estrellas |
nps_score | integer | No | 0-10 NPS score |
text_feedback | string | No | Free-text feedback |
customer_name | string | No | Submitter name |
customer_email | string | No | Submitter email |
survey_responses | object | No | Custom survey field answers |
Response (201 Created)
{
"data": {
"id": 43,
"campaign_id": 1,
"star_rating": 5,
"status": "pending",
"created_at": "2024-03-15T11:00:00Z"
},
"message": "Submission created successfully"
}