Last active
January 27, 2021 01:06
-
-
Save svarukala/347feabafd70d50dedb28ff8bbbb62da to your computer and use it in GitHub Desktop.
Python sample to get a SharePoint Online Site title
This file contains hidden or 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
from office365.runtime.auth.client_credential import ClientCredential | |
from office365.sharepoint.client_context import ClientContext | |
client_id = '--clientid--' | |
client_secret = '--clientsecret---' | |
site_url = 'https://contoso.sharepoint.com/sites/Web01' | |
credentials = ClientCredential(client_id, | |
client_secret) | |
ctx = ClientContext(site_url).with_credentials(credentials) | |
target_web = ctx.web.get().execute_query() | |
print(target_web.url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment