End-user sending a text message

381

When the end-user writes and sends a “Hello, what can you do?” message, you (the integrator) should send the following payload:

{
  "end_user_token": "df6a0edc-b31d-461x-ydcx-f7d5f02cd3d0",
  "message": {
    "text": "Hello, what can you do?"
  }
}

End-user clicking on a quick reply

377

When the end-user clicks on the “Get a refund for a damaged package” quick reply, you should send the following payload:

{
  "end_user_token": "df6a0edc-b31d-461x-ydcx-f7d5f02cd3d0",
  "message": {
    "quick_reply": {
        "payload": "{\"target_use_case_uuid\": \"5f73118d-3672-4816-b196-858470a61e4d\", \"target_node_uuid\": \"7a462bfe-d2fa-4e76-b7e9-61843343406c\", \"target_edge_uuid\": \"4d58d113-e95b-4982-9ac0-663d16477563\", \"target_substep_name\": null, \"substep_parameters\": null, \"title\": \"Get a refund for a damaged package\"}"
    },
    "text": "Get a refund for a damaged package"
  }
}

The target_use_case_uuid, the target_node_uuid, the target_edge_uuid, the target_substep_name, and the substep_parameters can be retrieved from the previous payload (the one showing the quick replies) sent by the bot.

End-user sending a file

382
  1. When the end-user sends a file, you should first upload the file on our server and retrieve a uuid identifying the image. Use a multipart/form-data POST request to the following URL https://uploads.mindsay.com (below an example with curl):
curl -v -F file='@./Images/my_damaged_package.png' https://uploads.mindsay.com\?filename\=my_damaged_package.png

# Returns
# {
#     "file_info":
#     {
#         "uuid": "1792c764-ff48-4eaa-8492-45dd0442fdea"
#     },
#     "message": "File successfully uploaded",
#     "status": 200
# }
  1. Then send the following payload to the bot
{
    "end_user_token": "df6a0edc-b31d-461x-ydcx-f7d5f02cd3d0",
    "message": {
        "file_info": {
            "uuid": "1792c764-ff48-4eaa-8492-45dd0442fdea",
            "name": "my_damaged_package.png"
        }
    },
}

End-user sending a CSAT data

692

user gives a positive feedback

684

User submits comment

When the end-user completed the CSAT survey (in our example, clicking on “Skip” or on “Submit feedback”), you should send the following payload:

{
    "context": {
        "first_name": "Eric"
    },
    "end_user_token": "df6a0edc-b31d-461x-ydcx-f7d5f02cd3d0",
    "message": {
        "quick_reply": {
            "payload": "{\"type\": \"csat_event\", \"is_positive_rating\": true, \"comment\": \"Thank you for the help!\", \"title\": \"CSAT\", \"meta_content\": {\"message_id\":\"ecafc028-f92e-459b-a172-2bdffb13e867\",\"service_record_id\":17,\"case_statement_record_id\":11}}"
        },
        "text": "CSAT result"
    }
}

These following fields are proper to the CSAT:

type: csat_event.

is_positive_rating: If the user gives positive feedback, it should be true, otherwise it should be false

comment: the comment submit by user, it can be empty.

title: the title of csat event, it can be empty

meta_content: The meta_content can be retrieved from the previous message sent by the bot.