PHP code example of devbackend / authgram-request-handler

1. Go to this page and download the library: Download devbackend/authgram-request-handler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devbackend / authgram-request-handler example snippets




$requestHandler = new Devbackend\AuthGramRequestHandler\AuthGramRequestHandler('[APPLICATION_TOKEN]');

if ($requestHandler->isValidToken()) {
    $request = $requestHandler->getRequest();

    $authKey  = $request->getAuthKey();
    $user     = $request->getUser();    
    $username = $user->getUsername();
}