General configure in .env file
Key | Description | Value |
---|---|---|
VIRTUAL_PATH | If you change the virtual directory when installing, you should change this value | Example: /chatbot |
CHATBOT_API_ENDPOINT | The endpoint path which chatbot uses to receive the message | Example: /api/messages |
LINKSCOPE_API_URL | LinkScope API endpoint (includes port if exists) | Example: http://localhost/api |
API_TOKEN | Chatbot uses this value to authenticate LinkScope API and BotConnnector message | |
REPLY_ENDPOINT | The endpoint path which custom DLL uses to send the agent's message to the user | Example: /api/replymessage |
Send out SMS API
Note: this logic is implemented in all chatbot
Url: chatbot_endpoint/VIRTUAL_PATH/REPLY_ENDPOINT
Method: POST
Header:
Authorization: API_TOKEN
Get this value in the .env file of the bot
Body:
{ ContactMessageUID: "phone number", // if this phone is not included country code, chatbot will append default country code. Content: "your message" }
Response:
{ result: true/false error: string }
Some chatbot configuration for sending out SMS in .env file:
Key | Description | Value |
---|---|---|
SMS_CHANNEL | Specify SMS Contact Channel which used to send SMS out. Refer Channel Id(Channel Information) in this link to get this value | Example: ZIP, TWI, QBL, RIN |
DEFAULT_COUNTRY_CODE | If your phone without a country code, the chatbot will append this value to your phone | Example: 1 |
SMS_CONTACT_ID | If this value is set, the chatbot will find contact config has ContactID = SMS_CONTACT_ID and SubContactType = SMS_CHANNEL In case no contact is found, the chatbot will get the first contact config and use this to send out SMS | You should get this value from the "Channel Id" column in the "Channel Information" section in this link |
SERVICE_URL | When using this value? This value is only used when a chatbot send a proactive message to the user The bot connector endpoint. Note: Only enter domain. Including port (if exists) | Example: http://localhost/botconnector |
Which do chatbots apply to send out API?
- General bot
- Verification bot
- Easypay bot
General bot
Name | Description | Value |
---|---|---|
CHATBOT_PUBLIC_DOMAIN | Use this value to share the file in general bot | Ex: http://localhost/ |
ENABLE_MESSAGE_STATUS | To enable message status in the general bot, set this value equals 1 | 1/0 |
Upload file API
Url: chatbot_endpoint/api/upload
Method: POST
Headers:
Content-Type: multipart/form-data; Authorization: API_TOKEN
Body: Form Data
Example:
{ {key}: file }
Response
Success:
Status code: 200
{ {key}: file_url }
Failed
The server will respond to the status code
- 400 in some case:
- Size is more than 5MB
- The extension is not valid. Valid extension of file: '.jpg', '.jpeg', '.bmp', '.gif', '.png', '.svg', '.txt', ".doc", ".docx", ".pdf", ".ppt", ".xls", ".xlsx", ".csv"
- The body is empty
- 500 when the server has an exception error
Verify bot
Name | Description | Value |
---|---|---|
DEMO_TPG | If set this value equals 1, the verify bot will only ask for customer id and reason. Otherwise, it will work with the normal flow | 1/0 |
Checklist
- LINKSCOPE_API_URL is required. Ex: http://localhost/api
- Make sure API_TOKEN is correct in Bot Connector and Chatbot
- Enter this URL to the browser: DOMAIN/VIRTUAL_PATH/CHATBOT_API_ENDPOINT. If it returns status 405, it is working