Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OneDrive sitepages namespace support ^ examples update
- Loading branch information
Showing
23 changed files
with
636 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
""" | ||
Get the list of applications in this organization | ||
https://learn.microsoft.com/en-us/graph/api/application-list?view=graph-rest-1.0&tabs=http | ||
https://learn.microsoft.com/en-us/graph/api/application-list?view=graph-rest-1.0 | ||
""" | ||
|
||
from office365.graph_client import GraphClient | ||
from tests.graph_case import acquire_token_by_username_password | ||
from tests import test_client_id, test_password, test_tenant, test_username | ||
|
||
client = GraphClient(acquire_token_by_username_password) | ||
client = GraphClient.with_username_and_password( | ||
test_tenant, test_client_id, test_username, test_password | ||
) | ||
apps = client.applications.get().top(10).execute_query() | ||
for app in apps: | ||
print(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
""" | ||
Get site by url | ||
https://learn.microsoft.com/en-us/graph/api/site-get?view=graph-rest-1.0&tabs=http | ||
https://learn.microsoft.com/en-us/graph/api/site-get?view=graph-rest-1.0 | ||
""" | ||
from office365.graph_client import GraphClient | ||
from tests import test_team_site_url | ||
from tests.graph_case import acquire_token_by_client_credentials | ||
from tests import test_client_id, test_client_secret, test_team_site_url, test_tenant | ||
|
||
client = GraphClient(acquire_token_by_client_credentials) | ||
client = GraphClient.with_client_secret(test_tenant, test_client_id, test_client_secret) | ||
site = client.sites.get_by_url(test_team_site_url).get().execute_query() | ||
print("Site Id: {0}".format(site.id)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
If the specified login name belongs to a valid user of the site, returns the User object corresponding to that user. | ||
If the specified login name belongs to a valid user outside of the site, adds the user to the site and | ||
returns the User object corresponding to that user. | ||
""" | ||
from office365.sharepoint.client_context import ClientContext | ||
from tests import test_admin_credentials, test_team_site_url, test_user_principal_name | ||
|
||
client = ClientContext(test_team_site_url).with_credentials(test_admin_credentials) | ||
target_user = client.web.ensure_user(test_user_principal_name).execute_query() | ||
print(target_user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.