Skip to content

Commit be224f4

Browse files
author
Yordy Gelvez
committed
Improvements and clarifications for user guide
1 parent 3305858 commit be224f4

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

README.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,36 @@ pip install microsoftgraph-python
77
```
88

99
## Usage
10+
If you need an office 365 token, send office365 attribute in True like this:
1011
```
1112
from microsoftgraph.client import Client
12-
client = Client('CLIENT_ID', 'CLIENT_SECRET', account_type='by defect common')
13+
client = Client('CLIENT_ID', 'CLIENT_SECRET', account_type='by defect common', office365=True)
1314
```
1415

15-
#### Get authorization url
16-
for office 365
16+
If you don't, just instance the library like this:
1717
```
18-
url = client.authorization_url(redirect_uri, scope, state=None, office365=True)
18+
from microsoftgraph.client import Client
19+
client = Client('CLIENT_ID', 'CLIENT_SECRET', account_type='by defect common')
1920
```
20-
for microsoft graph
21+
22+
#### Get authorization url
2123
```
22-
url = client.authorization_url(redirect_uri, scope, state=None, office365=False)
24+
url = client.authorization_url(redirect_uri, scope, state=None)
2325
```
2426

2527
#### Exchange the code for an access token
26-
for office 365
2728
```
28-
token = client.exchange_code(redirect_uri, code, office365=True)
29-
```
30-
for microsoft graph
31-
```
32-
token = client.exchange_code(redirect_uri, code, office365=False)
29+
token = client.exchange_code(redirect_uri, code)
3330
```
3431

3532
#### Refresh token
36-
for office 365
37-
```
38-
token = client.refresh_token(redirect_uri, refresh_token, office365=True)
3933
```
40-
for microsoft graph
41-
```
42-
token = client.refresh_token(redirect_uri, refresh_token, office365=False)
34+
token = client.refresh_token(redirect_uri, refresh_token)
4335
```
4436

4537
#### Set token
46-
for office 365
47-
```
48-
token = client.set_token(token, office365=True)
49-
```
50-
for microsoft graph
5138
```
52-
token = client.set_token(token, office365=False)
39+
token = client.set_token(token)
5340
```
5441

5542
#### Get me

0 commit comments

Comments
 (0)