File tree Expand file tree Collapse file tree 4 files changed +25
-11
lines changed
Expand file tree Collapse file tree 4 files changed +25
-11
lines changed Original file line number Diff line number Diff line change 1- # Introduction
2-
3- This library is a ** PHP client** for ** Slack's Web API** .
1+ # A PHP client for Slack's API
42
53There is a bunch of existing PHP clients for Slack. But some are not up to date
64or miss features, some only cover a small part of the API and most are simply
@@ -40,6 +38,8 @@ $client = JoliCode\Slack\ClientFactory::create($yourSlackToken);
4038$user = $client->usersInfo(['user' => 'U123AZER'])->getUser();
4139```
4240
41+ ## Documentation
42+
4343Want more documentation or examples? See the [ full documentation here] ( https://jolicode.github.io/slack-php-api/ ) .
4444
4545## Further documentation
Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ You can now install the Slack client:
1919composer require jolicode/slack-php-api
2020```
2121
22+ ## Slack token
23+
24+ Before you can use this client, you need to retrieve a token from Slack.
25+
26+ Checkout Slack's documentation about [ all different kind of tokens] ( https://api.slack.com/authentication/token-types ) .
27+ A good starting point is the [ Authentication Basics documentation] ( https://api.slack.com/authentication/basics ) .
28+
2229## Quick start
2330
2431``` php
Original file line number Diff line number Diff line change 11# Usage
22
3- ## Slack token
4-
5- Before you can use this client, you need to retrieve a token from Slack.
6-
7- Checkout Slack's documentation about [ all different kind of tokens] ( https://api.slack.com/authentication/token-types ) .
8- A good starting point is the [ Authentication Basics documentation] ( https://api.slack.com/authentication/basics ) .
9-
103## Basic usage of the client
114
125Use the ` ClientFactory ` to generate a ` Client ` configured with your token:
@@ -28,9 +21,23 @@ PHPdoc to know which option you can provide to each method:
2821<?php
2922//...
3023
31- $members = $client->usersList(['limit' => 100])->getMembers();
24+ $user = $client->usersInfo(['user' => 'U123AZER'])->getUser();
25+
26+ dump($user);
3227```
3328
29+ Here is what a User object looks like:
30+
31+ <p align =" center " >
32+ <img src =" images/model-sample.png " alt =" Sample user object " />
33+ <p >
34+
35+ To summarize - the whole SDK is built with objects. Each endpoints, responses
36+ and models have their own PHP classes with correct typehinting and PHPDoc.
37+
38+ Along with [ official Slack documentation] ( https://api.slack.com/methods ) , your
39+ favorite PHP editor should be a good ally to explore the whole API.
40+
3441## Iterating over pagination
3542
3643Some Slack API endpoints use a cursor based pagination.
You can’t perform that action at this time.
0 commit comments