With Facebook Messenger, you can create your own Custom Commands (and buttons) to perform GET/POST requests! For example, you can create a custom command "arm alarm" that will call to a REST API on your domotics system that will trun on/off a light. Each command will be associated to an URL that the bot will call with GET or POST method.
See below the instructions to create and maintain your own commands.
You need to get a personal APIkey before using the API. So only you can send messages to yourself.
Just follow these simple steps:
- Start a Facebook Messenger conversation with @api.callmebot. Or click here: https://m.me/api.callmebot
- Send "create apikey" to @api.callmebot (using Facebook Messenger of course)
- The bot will generate a secure apikey for you.
- The bot will answer you with your personal apikey .
You can now start sending notifications to yourself through Facebook Messenger.
List of instructions to manage your commands.
There are 5 admin instructions to manage your own commands:
create command [name] [GET/POST] [url] [header] [body]
[name]: The name of the command. This is what you will write to the bot to perfom the request. For example "Light on".
[GET/POST]: Method to use by the Bot to perform the request. GET or POST
[url]: URL to use by the Bot to perform the GET or POST. It has to be urlencoded. You can use this online converter to encode the url. (i.e. %20 for space).
Very soon, the API will allow users to:
- Send images
- Send GET/POST requestes to your devices based on customizable commands from you.
If you have problems, like not receiving the Call on Telegram, or not receiving the WhatsApp messages, try to test the CallMeBot API using your Web Browser:
- Telegram Phone Calls using Web Browser: here
- Telegram Text Messages using Web Browsers: here
- WhatsApp Text Messages using Web Browser: here
You might get some errors on the screen that will help you to identify the problem. (Ex: Calls disabled in the Telegram Security Settings, WhatsApp not activated, etc.)
If you still have problems using the API, don’t hesitate to contact me in Telegram @callmebot_com or by email at [email protected]. Remember to Follow me on Twitter to get news about coming features, changes, invitations, etc.