【发布时间】:2022-07-14 01:57:16
【问题描述】:
我想使用 Microsoft Graph API 在 SharePoint 术语组中创建一个新术语组
使用 Azure Active Directory 中的以下权限通过 get 请求读取术语组:“TermStore.ReadWrite.All - 应用程序 - 读取和写入所有术语库数据。
但是通过 post 请求创建会导致错误 400/403。
Termstore 应用程序权限在 AAD 中可用,但文档并未说明。 Link to MS graph termstore doc.
termstore_get_groups = (
req.get(
url = f"https://graph.microsoft.com/v1.0/sites/{root_site_id}/termStore/groups",
headers= {"Authorization" : f"Bearer {access_token}", "Host" : "graph.microsoft.com"}
)
)
termstore_create_group = (
req.post(
url = f"https://graph.microsoft.com/v1.0/sites/{root_site_id}/termStore/groups",
headers= {"Authorization" : f"Bearer {access_token}"},
data= {"displayName" : "Test"}
)
)
【问题讨论】:
标签: python-3.x azure-active-directory microsoft-graph-api