VK.com Bot Creating Webhooks
First step to make a VK.com bot is setting up Webhooks. VK.com is a most popular social media in Europe and East region after Facebook. You can make VK.com bot to get more clients and simple communicate with them. Webhooks are JSON response from VK.com server about any changes (messages, news, requests, etc...). How to make your server to receive this JSON responses from VK.com?Go to your VK.com Group - Press Manage community, then Api Usage.
Press Create Token button. Done!
Setting up and confirmation VK.com Webhooks
Open PHP file and copy this script
$confirmation_token = "************"; // confirmation token is String to be returned.
$data = json_decode(file_get_contents('php://input'));
$conf = $data->{'type'};
if($conf == "confirmation")
{
echo "$confirmation_token";
}
Copy String to be returned from VK.com and type this code as $confirmation_token. Upload vk.php file to your server and type link to Your server endpoint. Press confirm button. Webhooks for VK.com confirmed. Now, you will receive all JSON data from your group to this link.
Press events type to regulate what request you allow to receive from VK.com with JSON.
https://www.facebook.com/chakabiz
https://vk.com/club148594693
https://www.youtube.com/channel/UCYuMRNb_SRZ4FMsZjnHRZUA
http://aaronsmith-rustech.blogspot.com
No comments:
Post a Comment