Rating and Survey
Survey Guide Line
Survey Add-ons allows bot to collect and manage survey data from users.
Manage Add-on
Access: https://survey.fpt.ai. Login with FPT ID account.
Add a new Survey
- Create a new Survey:

- Create a new Question for Survey:

- Copy token:
Token is used for bot to call add-on

Survey Statistics
- Get detail report for a Survey

- Survey statistics information

- Get detail report for a Question

- Question statistics information

Manage Bot
Bot is created to use survey add-on
Access: http://bot.fpt.ai. Login with FPT ID account
Create new bot
Setup variables
| ID | Variable name | Entity Type | Validation | Description |
|---|---|---|---|---|
| 1 | survey_name | None | text | Survey Name |
| 2 | survey_completed | None | text | True: Users completed survey, False: Users uncompleted survey |
| 3 | question | None | text | Question |
| 4 | choice | None | text | Choice |
Setup constant
| ID | Constant name | Value | Description |
|---|---|---|---|
| 1 | token | text | Authorized key to call survey add-on (Key can be copied as described above) |
Setup scenario
- Add step GetSurvey
- Add JSON card:
Method: GET
URL: https://survey.fpt.ai/get-survey
Authorization: Bearer {{token}}
Variable: None
Condition: survey_completed != True

- Add Text card:
Content:Welcome to {{survey_name}}
Condition: survey_completed != True
- Add Next Step card:
Next Step: GetQuestion

- Add JSON card:
- Add step GetQuestion
- Add JSON card:
Method: GET
URL: https://survey.fpt.ai/get-question
Authorization: Bearer {{token}}
Variable: sender_id

- Add Next Step card:
Next Step: End Condition: survey_completed = True

- Add JSON card:
- Add Step Answer
- Add JSON card:
Method: POST
URL: https://survey.fpt.ai/api/user-choice/
Authorization: Bearer {{token}}
Variable: sender_id, question, choice

- Add Next Step card:
Next Step: GetQuestion
Condition: survey_completed != True

- Add JSON card:
- Add Step End
- Add Text card:
Content:Thanks

- Add Text card:
