Skip to content

Commit 6309725

Browse files
committed
Tweak the documentation after review
1 parent 72a64e7 commit 6309725

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Introduction
2-
3-
This library is a **PHP client** for **Slack's Web API**.
1+
# A PHP client for Slack's API
42

53
There is a bunch of existing PHP clients for Slack. But some are not up to date
64
or 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+
4343
Want more documentation or examples? See the [full documentation here](https://jolicode.github.io/slack-php-api/).
4444

4545
## Further documentation

docs/1-get-started.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ You can now install the Slack client:
1919
composer 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

docs/2-usage.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
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

125
Use 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

3643
Some Slack API endpoints use a cursor based pagination.

docs/images/model-sample.png

120 KB
Loading

0 commit comments

Comments
 (0)