Download the PHP package flourishlabs/saloon-slack without Composer
On this page you can find all versions of the php package flourishlabs/saloon-slack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download flourishlabs/saloon-slack
More information about flourishlabs/saloon-slack
Files in flourishlabs/saloon-slack
Package saloon-slack
Short Description Saloon connectors/requests for Slack
License MIT
Homepage https://github.com/flourishlabs/saloon-slack
Informations about the package saloon-slack
Saloon for Slack
Introduction
The power of Slack powered by Saloon
Installation
Install the package via composer:
Usage - API
Instance
Create an instance
Generic GET
Generic POST
Responses
The most useful method you'll need on a Response object is json
:
Saloon's documentation is best for responses, but there are extra Slack specific methods available too.
-
hasWarning(): bool
&warning(): string
From Slack docs: In the case of problematic calls that could still be completed successfully, ok will be true and the warning property will contain a short machine-readable warning code (or comma-separated list of them, in the case of multiple warnings). hasError(): bool
&error(): string
From Slack docs For failure results, the error property will contain a short machine-readable error code.
Usage - OAuth
You can also interact with Slack's OAuth through the SlackAuthConnector
.
Instance
Create an Auth instance
Generate auth URL
You'll likely want to generate & store state
in session to verify during token exchange.
You'll want to redirect the user to this authorization URL
Exchange
If you need to access the bot and user token you should return the response.
If you only need the bot token you can use the standard Saloon setup (their docs).
You can then use these tokens as normal to instantiate a SlackConnector.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Ashley Hindle
- All Contributors
License
The MIT License (MIT). Please see License File for more information.