Skip to content

Commit a059338

Browse files
authored
Update the docs
1 parent 25235e7 commit a059338

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,15 @@ composer require orgmanager/orgmanager-api
2121
You must pass a Guzzle client and the API token to the constructor of `OrgManager\ApiClient\OrgManager`.
2222

2323
``` php
24-
$client = new \GuzzleHttp\Client();
25-
26-
$token = 'YOUR_ORGMANAGER_API_TOKEN';
27-
28-
$orgmanager = new \OrgManager\ApiClient\OrgManager($client, $token);
24+
$orgmanager = new \OrgManager\ApiClient\OrgManager('YOUR_ORGMANAGER_API_TOKEN');
2925
```
3026

3127
or you can skip the token and use the `connect()` method later
3228

3329
``` php
34-
$client = new \GuzzleHttp\Client();
35-
36-
$token = 'YOUR_ORGMANAGER_API_TOKEN';
30+
$orgmanager = new \OrgManager\ApiClient\OrgManager();
3731

38-
$orgmanager = new \OrgManager\ApiClient\OrgManager($client);
39-
40-
$orgmanager->connect($token);
32+
$orgmanager->connect('YOUR_ORGMANAGER_API_TOKEN');
4133
```
4234

4335
### Get User info
@@ -82,6 +74,20 @@ $orgmanager->regenerateToken($set);
8274
```
8375
where `$set` is false if you don't want to use the new token on future requests.
8476

77+
### Get the Guzzle Client
78+
79+
``` php
80+
$orgmanager->getClient();
81+
```
82+
83+
### Set the Guzzle Client
84+
85+
``` php
86+
$client = new \GuzzleHttp\Client(); // Example Guzzle client
87+
$orgmanager->setClient($client);
88+
```
89+
where $client is an instance of `\GuzzleHttp\Client`.
90+
8591
## Changelog
8692

8793
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

0 commit comments

Comments
 (0)