Skip to content

Surveys

Endpoints for querying available surveys.

List Surveys

GET /api/searches

Returns the list of surveys linked to the user's token.

Use cases:

  • Get survey IDs for integration
  • Populate survey selectors
  • Validate available surveys for dispatch

Request Example

bash
curl -X GET "https://api-b2s.experienciab2s.com/api/searches" \
     -H "Authorization: Bearer YOUR_TOKEN"

Success Response (200)

json
[
  {
    "id": "103a525c-0ce3-4182-a504-aad595425233",
    "name": "Satisfaction Survey - Restaurant",
    "company_id": "603a525c-0ce3-4182-a504-aad595425233"
  },
  {
    "id": "203a525c-0ce3-4182-a504-aad595425233",
    "name": "Satisfaction Survey - Delivery",
    "company_id": "503a525c-0ce3-4182-a504-aad595425233"
  }
]

Response Structure

FieldTypeDescription
idstringUnique survey ID (UUID)
namestringSurvey name
company_idstringLinked company ID (UUID)

Response Codes

CodeDescription
200Surveys found
401Missing or invalid token
403Invalid token or unauthorized user
404Integration token not found

Get Survey with Questions

GET /api/searches/:id

Returns the complete details of a specific survey, including all configured questions, response options, and available translations.

Use cases:

  • Render custom survey form
  • Get complete question structure for integration
  • Load question translations for multilingual systems
  • Validate question types and formats before submission

URL Parameters

ParameterTypeRequiredDescription
idstringYesUnique survey ID (UUID)

Request Example

bash
curl -X GET "https://api-b2s.experienciab2s.com/api/searches/103a525c-0ce3-4182-a504-aad595425233" \
     -H "Authorization: Bearer YOUR_TOKEN"

Success Response (200)

json
{
  "nps": "How do you rate your experience?",
  "discursive_question": "Leave your comment",
  "questions": [
    {
      "id": "q1-uuid-example",
      "name": "How do you rate the service?",
      "required": true,
      "others": false,
      "unknown": false,
      "description": "Rate the quality of the service received",
      "type": "Rating",
      "format": "default",
      "detractor_replica": "We're sorry for your experience",
      "neutral_replica": "Thank you for your feedback",
      "promoter_replica": "We're happy with your rating!",
      "options": [
        {
          "id": "opt1-uuid",
          "name": "Excellent",
          "optionTranslations": [
            {
              "id": "trans1-uuid",
              "option_id": "opt1-uuid",
              "language_code": "pt",
              "name": "Excelente"
            },
            {
              "id": "trans2-uuid",
              "option_id": "opt1-uuid",
              "language_code": "es",
              "name": "Excelente"
            }
          ]
        }
      ],
      "translations": [
        {
          "id": "qtrans1-uuid",
          "question_id": "q1-uuid-example",
          "language_code": "pt",
          "name": "Como você avalia o atendimento?",
          "description": "Avalie a qualidade do atendimento recebido",
          "promoter_replica": "Ficamos felizes com sua avaliação!",
          "neutral_replica": "Obrigado pelo feedback",
          "detractor_replica": "Lamentamos pela sua experiência"
        }
      ]
    },
    {
      "id": "q2-uuid-example",
      "name": "Select the attendant",
      "required": true,
      "others": false,
      "unknown": true,
      "description": "Choose the attendant who served you",
      "type": "Atendente",
      "format": "select",
      "options": [
        {
          "id": "att1-uuid",
          "name": "John Smith",
          "optionTranslations": []
        },
        {
          "id": "att2-uuid",
          "name": "Mary Johnson",
          "optionTranslations": []
        }
      ],
      "translations": []
    }
  ]
}

Response Structure

FieldTypeDescription
npsstringMain NPS question text
discursive_questionstringDiscursive/comment question text
questionsarrayList of survey questions

Question Structure

FieldTypeDescription
idstringUnique question ID (UUID)
namestringQuestion text/title
requiredbooleanWhether the question is required
othersbooleanWhether "Others" option is allowed
unknownbooleanWhether "Don't know/Unknown" option is allowed
descriptionstringAuxiliary question description
typestringQuestion type (see table below)
formatstringDisplay format (see table below)
detractor_replicastringFollow-up question for low scores - optional
neutral_replicastringFollow-up question for medium scores - optional
promoter_replicastringFollow-up question for high scores - optional
optionsarrayAvailable response options
translationsarrayQuestion translations in other languages

Question Types (type)

TypeDescription
AtendenteAttendant/employee selection
Caixa de seleçãoMultiple choice with checkboxes
CSATCustomer Satisfaction Score (1-5)
DataDate selection field
EmoticonEmoticon/emoji rating
Like/DislikeBinary rating (like/dislike)
Multipla escolhaSelection among multiple options
NPSNet Promoter Score (0-10)
RatingStar/score rating
Resposta curtaFree text field

Display Formats (format)

FormatDescriptionAvailable in
defaultDefault display (buttons/cards)All types
selectDropdown menuAtendente, Multipla escolha
checkboxMultiple selection checkboxAtendente

Option Structure

FieldTypeDescription
idstringUnique option ID (UUID)
namestringOption text
optionTranslationsarrayOption translations in other languages

OptionTranslation Structure

FieldTypeDescription
idstringUnique translation ID (UUID)
option_idstringRelated option ID
language_codestringLanguage code (e.g., "pt", "es")
namestringTranslated option text

QuestionTranslation Structure

FieldTypeDescription
idstringUnique translation ID (UUID)
question_idstringRelated question ID
language_codestringLanguage code (e.g., "pt", "es")
namestringTranslated question text
descriptionstringTranslated description (optional)
promoter_replicastringTranslated follow-up question (high scores) (optional)
neutral_replicastringTranslated follow-up question (medium scores) (optional)
detractor_replicastringTranslated follow-up question (low scores) (optional)
criteriastringTranslated criteria (optional)

Response Codes

CodeDescription
200Survey found successfully
401Missing or invalid token
403Invalid token or unauthorized user
404Survey not found

Integration Documentation