-
-
Notifications
You must be signed in to change notification settings - Fork 370
Expand file tree
/
Copy pathcreate_comm.py
More file actions
17 lines (14 loc) · 597 Bytes
/
Copy pathcreate_comm.py
File metadata and controls
17 lines (14 loc) · 597 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Creates a modern communication site.
https://learn.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest
"""
from office365.sharepoint.client_context import ClientContext
from tests import test_client_id, test_password, test_site_url, test_tenant, test_username
ctx = ClientContext(test_site_url).with_username_and_password(
tenant=test_tenant,
client_id=test_client_id,
username=test_username,
password=test_password,
)
site = ctx.create_communication_site(alias="CommSite", title="Communication Site").execute_query()
print(f"Communication site created: {site.url}")