PHP code example of mcmatters / slack-api

1. Go to this page and download the library: Download mcmatters/slack-api 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/ */

    

mcmatters / slack-api example snippets




use McMatters\SlackApi\Message\Message;
use McMatters\SlackApi\SlackClient;
use McMatters\SlackApi\WebhookClient;

e::make('Hello world')
        ->from('HelloBot')
        ->to('#general')
        ->icon(':rocket:')
);

// Use Slack client wrapper.
$client = new SlackClient('TOKEN');
$client->get('users.info', ['user' => 'W1234567890']);