@@ -109,7 +109,7 @@ Steps to access:
109
109
Usage:
110
110
```python
111
111
from office365.sharepoint.client_context import ClientContext
112
- ctx = ClientContext(site_url ).with_interactive(tenant_name_or_id, client_id )
112
+ ctx = ClientContext("{site-url}" ).with_interactive("{tenant-name-or-id}", "{client-id}" )
113
113
me = ctx.web.current_user.get().execute_query()
114
114
print(me.login_name)
115
115
```
@@ -142,19 +142,17 @@ print("Web title: {0}".format(web.properties['Title']))
142
142
```
143
143
144
144
145
- 2 . ` RequestOptions class` - where you construct REST queries (and no model is involved)
145
+ 2 . ` SharePointRequest class` - where you construct REST queries (and no model is involved)
146
146
147
147
The example demonstrates how to read ` Web ` properties:
148
148
149
149
``` python
150
150
import json
151
151
from office365.runtime.auth.user_credential import UserCredential
152
- from office365.runtime.http.request_options import RequestOptions
153
- from office365.sharepoint.client_context import ClientContext
152
+ from office365.sharepoint.request import SharePointRequest
154
153
site_url = " https://{your-tenant-prefix}.sharepoint.com"
155
- ctx = ClientContext(site_url).with_credentials(UserCredential(" {username} " , " {password} " ))
156
- request = RequestOptions(" {0} /_api/web/" .format(site_url))
157
- response = ctx.pending_request().execute_request_direct(request)
154
+ request = SharePointRequest(site_url).with_credentials(UserCredential(" {username} " , " {password} " ))
155
+ response = request.execute_request(" web" )
158
156
json = json.loads(response.content)
159
157
web_title = json[' d' ][' Title' ]
160
158
print (" Web title: {0} " .format(web_title))
@@ -184,6 +182,7 @@ Refer [examples section](examples/sharepoint) for another scenarios
184
182
185
183
Example:
186
184
``` python
185
+ from office365.sharepoint.client_context import ClientContext
187
186
client_credentials = ClientCredential(' {client_id} ' ,' {client_secret} ' )
188
187
ctx = ClientContext(' {url} ' ).with_credentials(client_credentials, environment = ' GCCH' )
189
188
```
@@ -395,7 +394,7 @@ which corresponds to [`Create team` endpoint](https://docs.microsoft.com/en-us/g
395
394
``` python
396
395
from office365.graph_client import GraphClient
397
396
client = GraphClient(acquire_token_func)
398
- new_team = client.groups[" {group_id } " ].add_team().execute_query_retry()
397
+ new_team = client.groups[" {group-id }" ].add_team().execute_query_retry()
399
398
```
400
399
401
400
Additional examples:
0 commit comments