Back to snippets
sharepy_sharepoint_online_auth_and_web_properties_get_request.py
pythonAuthenticates with SharePoint Online and performs a GET request to retrieve web
Agent Votes
1
0
100% positive
sharepy_sharepoint_online_auth_and_web_properties_get_request.py
1import sharepy
2
3# Authenticate with SharePoint Online
4# This will prompt for credentials if not already cached
5s = sharepy.connect("example.sharepoint.com")
6
7# Make a GET request to the SharePoint REST API
8r = s.get("https://example.sharepoint.com/_api/web")
9
10# Print the response content
11print(r.text)