Skip to content

Commit

Permalink
2.5.11 release
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrem committed Jun 26, 2024
1 parent 261d42c commit 5445a1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Steps to access:
Usage:
```python
from office365.sharepoint.client_context import ClientContext
ctx = ClientContext(site_url).with_interactive(tenant_name_or_id, client_id)
ctx = ClientContext("{site-url}").with_interactive("{tenant-name-or-id}", "{client-id}")
me = ctx.web.current_user.get().execute_query()
print(me.login_name)
```
Expand Down Expand Up @@ -142,19 +142,17 @@ print("Web title: {0}".format(web.properties['Title']))
```


2. `RequestOptions class` - where you construct REST queries (and no model is involved)
2. `SharePointRequest class` - where you construct REST queries (and no model is involved)

The example demonstrates how to read `Web` properties:

```python
import json
from office365.runtime.auth.user_credential import UserCredential
from office365.runtime.http.request_options import RequestOptions
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.request import SharePointRequest
site_url = "https://{your-tenant-prefix}.sharepoint.com"
ctx = ClientContext(site_url).with_credentials(UserCredential("{username}", "{password}"))
request = RequestOptions("{0}/_api/web/".format(site_url))
response = ctx.pending_request().execute_request_direct(request)
request = SharePointRequest(site_url).with_credentials(UserCredential("{username}", "{password}"))
response = request.execute_request("web")
json = json.loads(response.content)
web_title = json['d']['Title']
print("Web title: {0}".format(web_title))
Expand Down Expand Up @@ -184,6 +182,7 @@ Refer [examples section](examples/sharepoint) for another scenarios

Example:
```python
from office365.sharepoint.client_context import ClientContext
client_credentials = ClientCredential('{client_id}','{client_secret}')
ctx = ClientContext('{url}').with_credentials(client_credentials, environment='GCCH')
```
Expand Down Expand Up @@ -395,7 +394,7 @@ which corresponds to [`Create team` endpoint](https://docs.microsoft.com/en-us/g
```python
from office365.graph_client import GraphClient
client = GraphClient(acquire_token_func)
new_team = client.groups["{group_id}"].add_team().execute_query_retry()
new_team = client.groups["{group-id}"].add_team().execute_query_retry()
```

Additional examples:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="Office365-REST-Python-Client",
version="2.5.10",
version="2.5.11",
author="Vadim Gremyachev",
author_email="[email protected]",
maintainer="Konrad Gądek, Domenico Di Nicola",
Expand Down

0 comments on commit 5445a1d

Please sign in to comment.