PHP code example of infinityxtech / slack-api-laravel
1. Go to this page and download the library: Download infinityxtech/slack-api-laravel 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/ */
infinityxtech / slack-api-laravel example snippets
// Call this when you wish to redirect user to authorize with slack
SlackAuth::redirect();
// Call this on $redirectUrl when slack authorization redirect to $redirectUrl
$token = SlackAuth::getAccessToken(request('code'));
// Create a new SlackApiProvider instance with access token
SlackApi::setToken($token);
// Below this point, you can use various API methods:
SlackApi::channel()->someMethod();
SlackApi::user()->someMethod();
SlackApi::chat()->someMethod();
SlackApi::auth()->someMethod();
SlackApi::apps()->someMethod();
SlackApi::conversations()->someMethod();
SlackApi::files()->someMethod();
SlackApi::reactions()->someMethod();
SlackApi::reminders()->someMethod();
SlackApi::teams()->someMethod();
SlackApi::userGroups()->someMethod();
SlackApi::views()->someMethod();