@@ -109,7 +109,7 @@ Steps to access:
109109 Usage:
110110```python
111111from 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}" )
113113me = ctx.web.current_user.get().execute_query()
114114print(me.login_name)
115115```
@@ -142,19 +142,17 @@ print("Web title: {0}".format(web.properties['Title']))
142142```
143143
144144
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)
146146
147147 The example demonstrates how to read ` Web ` properties:
148148
149149``` python
150150import json
151151from 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
154153site_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" )
158156json = json.loads(response.content)
159157web_title = json[' d' ][' Title' ]
160158print (" Web title: {0} " .format(web_title))
@@ -184,6 +182,7 @@ Refer [examples section](examples/sharepoint) for another scenarios
184182
185183 Example:
186184 ``` python
185+ from office365.sharepoint.client_context import ClientContext
187186 client_credentials = ClientCredential(' {client_id} ' ,' {client_secret} ' )
188187 ctx = ClientContext(' {url} ' ).with_credentials(client_credentials, environment = ' GCCH' )
189188 ```
@@ -395,7 +394,7 @@ which corresponds to [`Create team` endpoint](https://docs.microsoft.com/en-us/g
395394``` python
396395from office365.graph_client import GraphClient
397396client = 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()
399398```
400399
401400Additional examples:
0 commit comments