6. Using The NGROK and Developer Settings
In your browser, download the NGROK version suitable for your operating system from https://ngrok.com/download and open (run) the downloaded program. Then log in to your account on https://ngrok.com/. In the Setup & Installation section, completely copy the line containing the authtoken information.
In the executed NGROK program, type “ngrok http PortNumber” into the command line.
The default port number is 3978 ,but it can be changed. The default port number can be changed in the “.env” file as follows:
PORT=”desired port number”
If the port number is changed, the new port number that is in the “.env” file should also be entered in NGROK. If no changes are made to the port number, when the command “ngrok http 3978” is run, port 3978 on localhost becomes accessible via NGROK in the developer environment. (For more detailed information, see: https://ngrok.com/docs/)
The address information starting with “https” on the screen received from NGROK should be registered with CXPerium. This is necessary for developers to test the messages sent and responses received via WhatsApp during the chatbot development process. In other words, it is necessary for testing the project running locally.
In CXPerium, go to the Developer Settings page under the Assistant tab in the menu. On the incoming page, click the New Developers button in the upper right corner and fill in the related information in the modal that opens. The address starting with “https” taken from NGROK is entered as WEBHOOKS information by adding “/api/whatsapp” to the end and the save button is pressed. There should be no space on the left and right of the address entered in WEBHOOKS. Otherwise, the developer settings cannot be saved. Additionally, if the developer wants to communicate with the Chatbot via WhatsApp using a specific number, they should enter the number with a leading 9, such as 905551112233. For example, if the developer wants to test the process on their own phone number, they should enter their phone number here. If messages are received from numbers other than the numbers entered in this section during the development phase, the project running in local will not respond.
In case of NGROK shutdown, NGROK must be restarted and the port listening command must be entered for the project to run. NGROK will give different https addresses each time it is run. For this reason, the changed https address must be updated and saved on the developers page with the edit button where the related developer’s information is located. This process should be repeated for each different developer.
After the above steps are completed, developers will be able to use the “+90 850 309 45 52” number provided by QSOFT A.Ş. to test your Chatbot processes. Through this number, developers can test their Chatbot in a real environment and verify the functionality of the application. This allows developers to simulate real user scenarios using the Chatbot and detect any bugs or issues.