Skip to content

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

json
{
  "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"
}
FieldTypeRequiredDescription
npsnumberYesNPS score (0 to 10)
discursive_questionstringNoAnswer to the discursive question
questionsarrayNoList of additional question responses
created_atstringYesResponse creation date in YYYY-MM-DD HH:mm:ss format
search_idstringYesAssociated survey ID (UUID)
response_channelstringYesResponse channel: QRcode, Email, SMS, Chatbot, Web, Link, Whatsapp

Questions Fields

FieldTypeRequiredDescription
idstringYesQuestion ID (UUID)
namestring/arrayYesQuestion answer. For checkbox or multiple choice, send array: [{ "option": "name" }, ...]
suggestionstringNoAdditional suggestion or comment for the question

Request Example

bash
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)

json
{
  "id": "ef9fa264-3850-4bd2-875e-2b40a4dd432f",
  "company_id": "203a525c-0ce3-4182-a504-aad595425233"
}

Response Codes

CodeDescription
201Answer created successfully
400Validation error or malformed request
403Invalid token or unauthorized user
404Survey 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

ParameterTypeRequiredDescription
is_enpsbooleanYesFilter responses related to eNPS
date_startstringYesStart date in YYYY-MM-DD format
date_endstringYesEnd date in YYYY-MM-DD format
limitintegerYesMaximum number of responses per request (max 50)
offsetintegerYesNumber of responses to skip for pagination
search_idstringNoSurvey ID to filter responses (UUID format)
clients_onlybooleanNoReturn only responses associated with clients (default: false)

Request Example

bash
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)

json
{
  "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

ParameterTypeRequiredDescription
idstringYesUnique response ID (UUID format)

Request Example

bash
curl -X GET "https://api-b2s.experienciab2s.com/api/answers/03944421-7382-4d05-a278-80b44e7cb742" \
     -H "Authorization: Bearer YOUR_TOKEN"

Success Response (200)

json
{
  "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

CodeDescription
200Response found
403Invalid token or unauthorized user
404Response 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

ParameterTypeRequiredDescription
idstringYesUnique response ID (UUID format)

Request Body

json
{
  "status": "in-progress"
}
FieldTypeRequiredAccepted ValuesDescription
statusstringYesto-do, in-progress, doneNew status for the response

Request Example

bash
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)

json
{}

Response Codes

CodeDescription
201Status updated successfully
400Invalid status value or malformed request
403Invalid token or unauthorized user
404Response 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

ParameterTypeRequiredDescription
idstringYesUnique response ID (UUID format)

Request Body

json
{
  "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"
}
FieldTypeRequiredDescription
messagestringYesClosed loop description or resolution message
user_emailstringYesEmail of the user creating the closed loop
user_namestringYesName of the user creating the closed loop

Request Example

bash
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)

json
{
  "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

CodeDescription
201Closed loop created successfully
403Invalid token or unauthorized user
404Response or integration token not found

Integration Documentation