Chatbot Webhook

Project Objective

The Chatbot Webhook project is an application designed to manage and process satisfaction surveys. The application allows the creation, updating, and retrieval of surveys, as well as integration with external services to obtain and send survey data.

Features

  • Survey Creation: Allows the creation of new satisfaction surveys.
  • Survey Updating: Allows the updating of existing surveys.
  • Survey Retrieval: Allows the retrieval of data from existing surveys.
  • Integration with External Services: Integrates with external services to obtain and send survey data.

Accessible Routes

Base URL: https://chatbot-api.solucx.com.br/

GET /survey

Retrieves a survey.

Query Parameters

transactionIdrequirednumber
Transaction ID.
attemptIdrequirednumber
Attempt ID.
journeyrequiredstring
Survey journey.
sourcerequiredstring
Survey source. Possible values: email, sms, ura, whatsapp, push, facebook, tablet, widget, qrcode, employee, chatbot, workplace, portals.

Request Example

GET /survey?transactionId=123&attemptId=456&journey=test&source=whatsapp HTTP/1.1
Host: example.com
X-Solucx-Api-Key: your-api-key

Response Example

{
    "transactionId": 123,
    "attemptId": 456,
    "journey": "test",
    "classes": [
        {
            "classId": 1,
            "label": "Example Class",
            "type": "csat5Stars"
        }
    ]
}

POST /survey

Creates a new survey.

Request Body

{
    "transactionId": 123,
    "attemptId": 456,
    "journey": "test",
    "source": "whatsapp",
    "classes": [
        {
            "classId": 1,
            "label": "Example Class",
            "score": 5,
            "type": "csat"
        }
    ],
    "score": 8,
    "comment": "Example comment",
    "src": 7
}

Request Example

POST /survey HTTP/1.1
Host: example.com
Content-Type: application/json
X-Solucx-Api-Key: your-api-key
{
  "transactionId": 123,
  "attemptId": 456,
  "journey": "test",
  "source": "whatsapp",
  "classes": [
    {
      "classId": 1,
      "label": "Example Class",
      "score": 5,
      "type": "csat"
    }
  ],
  "score": 8,
  "comment": "Example comment",
  "src": 7
}

Response Example

{
    "attemptId": 456,
    "transactionId": 123
}

PUT /survey

Updates an existing survey.

Request Body

{
    "transactionId": 123,
    "attemptId": 456,
    "journey": "test",
    "source": "whatsapp",
    "classes": [
        {
            "classId": 1,
            "label": "Example Class",
            "score": 5,
            "type": "csat"
        }
    ],
    "score": 8,
    "comment": "Example comment",
    "src": 7
}

Request Example

PUT /survey HTTP/1.1
Host: example.com
Content-Type: application/json
X-Solucx-Api-Key: your-api-key
{
  "transactionId": 123,
  "attemptId": 456,
  "journey": "test",
  "source": "whatsapp",
  "classes": [
    {
      "classId": 1,
      "label": "Example Class",
      "score": 5,
      "type": "csat"
    }
  ],
  "score": 8,
  "comment": "Example comment",
  "src": 7
}

Response Example

HTTP/1.1 200 OK

Data Transfer Objects (DTOs)

SurveyParametersDto

Used to retrieve a survey.
transactionIdrequirednumber
Transaction ID.
attemptIdrequirednumber
Attempt ID.
journeyrequiredstring
Survey journey.
sourcerequiredstring
Survey source. Possible values: email, sms, ura, whatsapp, push, facebook, tablet, widget, qrcode, employee, chatbot, workplace, portals.

SurveyDto

Used to create or update a survey.
transactionIdrequirednumber
Transaction ID.
attemptIdrequirednumber
Attempt ID.
journeyrequiredstring
Survey journey.
classesrequiredClass[]
List of survey classes.
scorerequirednumber
Survey score.
commentstring
Survey comment.
srcRatingSource
Survey source. Possible values:
  • 1: Email
  • 2: SMS
  • 4: URA
  • 7: WhatsApp
namestring
Respondent's name.
phonestring
Respondent's phone.
storeIdstring
Store ID.
employeeIdstring
Employee ID.

Class

Used within the SurveyDto.
classIdrequirednumber
Class ID.
labelrequiredstring
Class label.
scorenumber
Class score.
typerequiredClassItemType
Class type.

RatingSourceName

The RatingSourceName enum provides descriptive names for the sources:

  • email
  • sms
  • ura
  • whatsapp
  • push
  • facebook
  • tablet
  • widget
  • qrcode
  • employee
  • chatbot
  • workplace
  • portals