Answers
Endpoints for querying and managing satisfaction survey responses.
Create Answer
POST /api/answers
Registers a new satisfaction survey response on the platform.
Use cases:
- Integrate responses from external channels (chatbot, kiosk, app)
- Sync offline collected responses
- Import responses from legacy systems
Request Body
{
"nps": 9,
"discursive_question": "Great service, very satisfied!",
"questions": [
{
"id": "103a525c-0ce3-4182-a504-aad595425233",
"name": "10",
"suggestion": "Congratulations on the service"
},
{
"id": "203a525c-0ce3-4182-a504-aad595425234",
"name": [{ "option": "Service" }, { "option": "Quality" }]
}
],
"created_at": "2024-04-15 14:30:00",
"search_id": "102a525c-0ce3-4182-a504-aad595425233",
"response_channel": "Chatbot"
}| Field | Type | Required | Description |
|---|---|---|---|
nps | number | Yes | NPS score (0 to 10) |
discursive_question | string | No | Answer to the discursive question |
questions | array | No | List of additional question responses |
created_at | string | Yes | Response creation date in YYYY-MM-DD HH:mm:ss format |
search_id | string | Yes | Associated survey ID (UUID) |
response_channel | string | Yes | Response channel: QRcode, Email, SMS, Chatbot, Web, Link, Whatsapp |
Questions Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Question ID (UUID) |
name | string/array | Yes | Question answer. For checkbox or multiple choice, send array: [{ "option": "name" }, ...] |
suggestion | string | No | Additional suggestion or comment for the question |
Request Example
curl -X POST "https://api-b2s.experienciab2s.com/api/answers" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"nps": 9,
"discursive_question": "Great service!",
"questions": [
{
"id": "103a525c-0ce3-4182-a504-aad595425233",
"name": "10",
"suggestion": "Congratulations"
}
],
"created_at": "2024-04-15 14:30:00",
"search_id": "102a525c-0ce3-4182-a504-aad595425233",
"response_channel": "Chatbot"
}'Success Response (201)
{
"id": "ef9fa264-3850-4bd2-875e-2b40a4dd432f",
"company_id": "203a525c-0ce3-4182-a504-aad595425233"
}Response Codes
| Code | Description |
|---|---|
| 201 | Answer created successfully |
| 400 | Validation error or malformed request |
| 403 | Invalid token or unauthorized user |
| 404 | Survey or integration token not found |
List Survey Answers
GET /api/answers
Returns a list of survey responses with filtering and pagination options. Results are limited to a maximum of 50 responses per request.
Use cases:
- Sync answers with external system
- Generate custom reports
- Feed BI dashboards
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
is_enps | boolean | Yes | Filter responses related to eNPS |
date_start | string | Yes | Start date in YYYY-MM-DD format |
date_end | string | Yes | End date in YYYY-MM-DD format |
limit | integer | Yes | Maximum number of responses per request (max 50) |
offset | integer | Yes | Number of responses to skip for pagination |
search_id | string | No | Survey ID to filter responses (UUID format) |
clients_only | boolean | No | Return only responses associated with clients (default: false) |
Request Example
curl -X GET "https://api-b2s.experienciab2s.com/api/answers?is_enps=true&date_start=2024-01-01&date_end=2024-01-31&limit=50&offset=0" \
-H "Authorization: Bearer YOUR_TOKEN"Success Response (200)
{
"limit": 50,
"offset": 0,
"total": 2,
"data": [
{
"id": "103a525c-0ce3-4182-a504-aad595425233",
"created_at": "2024-04-14T22:06:02.000Z",
"nps": 10,
"discursive_question": "",
"consumption": {
"id": "103a525c-0ce3-4182-a504-aad595425233",
"order_id": "order_123"
},
"company": {
"id": "103a525c-0ce3-4182-a504-aad595425233",
"name": "Company 1"
},
"search": {
"id": "103a525c-0ce3-4182-a504-aad595425233",
"name": "Dine-in"
},
"page": {
"id": "103a525c-0ce3-4182-a504-aad595425233",
"name": "Pickup"
},
"client": {
"id": "103a525c-0ce3-4182-a504-aad595425233",
"name": "John Doe",
"email": "johndoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "25/02/1980"
},
"criteria": [
{
"nick": "Service",
"name": "10",
"suggestion": "",
"type": "NPS"
}
]
}
]
}Get Answer by ID
GET /api/answers/{id}
Returns detailed information about a specific response, including client, consumption, company, page, and associated criteria.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique response ID (UUID format) |
Request Example
curl -X GET "https://api-b2s.experienciab2s.com/api/answers/03944421-7382-4d05-a278-80b44e7cb742" \
-H "Authorization: Bearer YOUR_TOKEN"Success Response (200)
{
"id": "03944421-7382-4d05-a278-80b44e7cb742",
"created_at": "2023-09-08T23:00:00.000Z",
"nps": 10,
"discursive_question": null,
"company": {
"id": "203a525c-0ce3-4182-a504-aad595425233",
"name": "Company Setup - 2"
},
"search": {
"id": "203a525c-0ce3-4182-a504-aad595425233",
"name": "Delivery"
},
"page": {
"id": "103a525c-0ce3-4182-a504-aad595425233",
"name": "Pickup"
},
"client": {
"id": "03944421-7382-4d05-a278-80b44e7cb742",
"name": "John",
"email": "john@example.com",
"phone": null,
"born_date": null
},
"consumption": {
"id": "03944421-7382-4d05-a278-80b44e7cb742",
"order_id": "order_1"
},
"criteria": [
{
"name": "Lorem",
"nick": "Short Answer",
"suggestion": null,
"type": "Short Answer"
},
{
"name": "4",
"nick": "Rating",
"suggestion": null,
"type": "Rating"
},
{
"name": "10",
"nick": "NPS",
"suggestion": null,
"type": "NPS"
}
]
}Response Codes
| Code | Description |
|---|---|
| 200 | Response found |
| 403 | Invalid token or unauthorized user |
| 404 | Response or integration token not found |
Update Answer Status
PATCH /api/answers/{id}
Updates the status of a specific response. This endpoint allows changing the processing state of customer responses, enabling workflow management and resolution state tracking.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique response ID (UUID format) |
Request Body
{
"status": "in-progress"
}| Field | Type | Required | Accepted Values | Description |
|---|---|---|---|---|
status | string | Yes | to-do, in-progress, done | New status for the response |
Request Example
curl -X PATCH "https://api-b2s.experienciab2s.com/api/answers/03944421-7382-4d05-a278-80b44e7cb742" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "in-progress"}'Success Response (201)
{}Response Codes
| Code | Description |
|---|---|
| 201 | Status updated successfully |
| 400 | Invalid status value or malformed request |
| 403 | Invalid token or unauthorized user |
| 404 | Response or integration token not found |
Create Closed Loop
POST /api/answers/{id}/description
Creates a closed loop (closing description) for a specific response. Allows adding follow-up information or resolution details to an existing response, enabling complete feedback tracking and customer service cycle closure.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique response ID (UUID format) |
Request Body
{
"message": "Customer issue was resolved by providing a discount coupon and following up via phone call.",
"user_email": "support@company.com",
"user_name": "Support Agent"
}| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Closed loop description or resolution message |
user_email | string | Yes | Email of the user creating the closed loop |
user_name | string | Yes | Name of the user creating the closed loop |
Request Example
curl -X POST "https://api-b2s.experienciab2s.com/api/answers/03944421-7382-4d05-a278-80b44e7cb742/description" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "Customer issue was resolved by providing a discount coupon.",
"user_email": "support@company.com",
"user_name": "Support Agent"
}'Success Response (201)
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"answer_id": "03944421-7382-4d05-a278-80b44e7cb742",
"description": "Customer issue was resolved by providing a discount coupon.",
"user_email": "support@company.com",
"user_name": "Support Agent - API",
"created_at": "2024-04-15T14:30:00.000Z"
}Response Codes
| Code | Description |
|---|---|
| 201 | Closed loop created successfully |
| 403 | Invalid token or unauthorized user |
| 404 | Response or integration token not found |
