Page tree
Skip to end of metadata
Go to start of metadata

General configure in .env file

KeyDescriptionValue
VIRTUAL_PATHIf you change the virtual directory when installing, you should change this valueExample: /chatbot
CHATBOT_API_ENDPOINTThe endpoint path which chatbot uses to receive the messageExample: /api/messages
LINKSCOPE_API_URLLinkScope API endpoint (includes port if exists)Example: http://localhost/api
API_TOKENChatbot uses this value to authenticate LinkScope API and BotConnnector message
REPLY_ENDPOINTThe endpoint path which custom DLL uses to send the agent's message to the userExample: /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:

KeyDescriptionValue
SMS_CHANNELSpecify SMS Contact Channel which used to send SMS out. Refer Channel Id(Channel Information) in this link to get this valueExample: ZIP, TWI, QBL, RIN
DEFAULT_COUNTRY_CODEIf your phone without a country code, the chatbot will append this value to your phoneExample: 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_URLWhen 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

NameDescriptionValue
CHATBOT_PUBLIC_DOMAINUse this value to share the file in general botEx: http://localhost/
ENABLE_MESSAGE_STATUSTo enable message status in the general bot, set this value equals 11/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

NameDescriptionValue
DEMO_TPGIf set this value equals 1, the verify bot will only ask for customer id and reason. Otherwise, it will work with the normal flow1/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


  • No labels