Skip to content

Commit 981a282

Browse files
Documentation improvements
1 parent c5ac1f4 commit 981a282

File tree

3 files changed

+25
-33
lines changed

3 files changed

+25
-33
lines changed

README.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ features, some only cover a small part of the API and most are simply no longer
55
maintained.
66

77
This SDK is generated automatically with [JanePHP](https://github.com/janephp/janephp)
8-
from the [official Slack API specs](https://github.com/slackapi/slack-api-specs). It provide a fully object oriented interface for all the endpoints, requests and responses of the Slack Web API.
8+
from the [official Slack API specs](https://github.com/slackapi/slack-api-specs).
9+
10+
It provides a **full object oriented interface** for all the endpoints, requests and responses of the Slack Web API.
911

1012
## Installation
1113

@@ -28,8 +30,10 @@ composer require jolicode/slack-php-api
2830

2931
## Usage
3032

31-
First, you need to retrieve a token - like an OAuth AccessToken or a legacy
32-
token. Checkout Slack's documentation about [all differents kind of tokens](https://api.slack.com/docs/token-types).
33+
First, you need to retrieve a token from Slack.
34+
35+
Checkout Slack's documentation about [all different kind of tokens](https://api.slack.com/authentication/token-types).
36+
A good starting point is the [Authentication Basics documentation](https://api.slack.com/authentication/basics).
3337

3438
Then, use the factory that is provided to create the client:
3539

@@ -46,35 +50,14 @@ dump($user);
4650
<img src="doc/images/model-sample.png" alt="Sample user object" />
4751
<p>
4852

49-
Want more example or documentation? See the [documentation](doc/index.md).
53+
Want more example or documentation? See the [full documentation here](doc/index.md).
5054

5155
## Troubleshoots
5256

5357
Got some problems using this library? Need a missing feature?
5458
Do not hesitate to [open an issue](https://github.com/jolicode/slack-php-api/issues)
5559
and share it with us.
5660

57-
### Missing data in the DTO?
58-
59-
The Slack specification is not up to date and miss some critical parts. We do
60-
build a [better one on top of the official](doc/updating-sdk.md) but it can't
61-
be perfect.
62-
63-
What's good is that some models use `\ArrayObject` as base classes so if the
64-
API returns data we don't have in the mapping, you can still access it via
65-
Array like syntax:
66-
67-
```php
68-
$results = $client->searchMessages([
69-
'query' => 'test'
70-
]);
71-
72-
var_dump($results->getOk()); // Mapped
73-
var_dump($results['messages']); // Not mapped but still readable
74-
```
75-
76-
Feel free to open issues for those missing fields.
77-
7861
## Further documentation
7962

8063
You can see the current and past versions using one of the following:
@@ -83,7 +66,7 @@ You can see the current and past versions using one of the following:
8366
* the [releases page on Github](https://github.com/jolicode/slack-php-api/releases)
8467
* the file listing the [changes between versions](CHANGELOG.md)
8568

86-
And finally some meta documentation:
69+
Finally, some meta documentation:
8770

8871
* [versioning and branching models](VERSIONING.md)
8972
* [contribution instructions](CONTRIBUTING.md)

doc/index.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,23 @@ If you miss an option in a method, until Slack add it to their spec, we can
5656
manually add it to our [versioned spec](../resources/slack-openapi.json) then
5757
[regenerate](updating-sdk.md) and release a new version of the library.
5858

59-
If you miss a property in a model, you may still access it by yourself. Some
60-
models extend the `ArrayObject` so you can access all its properties with the
61-
array notation. For example - until mid-2019 - the `usergroupsList` response
62-
did not contain the `usergroups` property, but we could access it this way:
59+
### Missing data in the DTO?
60+
61+
The Slack specification is not up to date and miss some critical parts. We do
62+
build a [better one on top of the official](doc/updating-sdk.md) but it can't
63+
be perfect.
64+
65+
What's good is that some models use `\ArrayObject` as base classes so if the
66+
API returns data we don't have in the mapping, you can still access it via
67+
Array like syntax:
6368

6469
```php
65-
$userGroupsResponse = $client->usergroupsList();
70+
$results = $client->searchMessages([
71+
'query' => 'test'
72+
]);
6673

67-
$groups = $userGroupsResponse['usergroups'];
74+
var_dump($results->getOk()); // Mapped
75+
var_dump($results['messages']); // Not mapped but still readable
6876
```
6977

78+
Feel free to open issues for those missing fields.

doc/updating-sdk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You can now build a new SDK using this patched specification.
2424

2525
## Regenerate the SDk
2626

27-
If you suspect that some endpoints or models have been removed, first remove all the content
27+
If you suspect some endpoints or models have been removed, first remove all the content
2828
of the `generated` directory:
2929

3030
```bash

0 commit comments

Comments
 (0)