- Meta Developer Account (https://developers.facebook.com/).
- CharGPT Account (https://platform.openai.com/apps).
- Hosting to have a valid domain (FQDN) with certificate.
- Install git (https://git-scm.com/downloads).
- Have a Github account, to keep control of source code (https://desktop.github.com/)
- Install Visual Studio Code (https://code.visualstudio.com/download)
- Add the following extensions in Visual Studio Code:
a. Color Highlight
b. Community Material Theme
c. Material Icon Theme
d. Material Them Icons - Install Postman to test the API (https://www.postman.com/downloads/).
Create a project in Meta Developer Account to obtain an API Key (Token) and our URL. If you want to see more detail on how to create it, we recommend you consult the following manual:
Chatbot_WhatsApp-ChatGPT-Api_With_PHP.pdf
Enter our OpenAI account and go to:
https://platform.openai.com/apps
Then in the upper right side go to our account. Create de API Key. If you want to see more detail on how to create it, we recommend you consult the following manual:
After having the two Tokens we proceed to create our project using Visual Studio Code. We download the complete code in:
https://github.com/VitalPBX/chatbot-whatsApp-ChatGPT-with-PHP
• chatbot_database.sql, database where the Chatbot information is stored, for example if a word is received, which must be answered.
• chatbot_database_with_data.sql, database where the Chatbot information is stored, for example if a word is received, which must be answered. This database have information.
• config.php, global settings such as database connection details, WhatsApp tokens, and ChatGTP.
• dbconextion.php, database query functions.
• webhook.php, code that is responsible for handling all requests from WhatsApp.