0

如果我有一个 ID 为“testteam@example.onmicrosoft.com”的 Office 365 组/Microsoft 团队,并且我想使用其中一个 beta API 来查询它我需要查询一个 URL,例如https://graph.microsoft.com/beta/groups/{id}/threads. 但是,我坚持对团队名称进行编码。https://graph.microsoft.com/beta/groups/testteam@example.onmicrosoft.com/threads, https://graph.microsoft.com/beta/groups/testteam@example%2Eonmicrosoft%2E/threads, 和https://graph.microsoft.com/beta/groups/testteam@example/threads,https://graph.microsoft.com/beta/groups/"testteam@example"/threads,https://graph.microsoft.com/beta/groups/"testteam@example.onmicrosoft.com"/threads返回以下错误

"error": {
    "code": "Request_BadRequest",
    "message": "Invalid object identifier 'whatever_I_entered'."
4

1 回答 1

1

据我了解,这只是常规的 URL 编码。例如在 JS 中你可以使用 function encodeURIComponent(str)。如果您想尝试使用在线 URL 编码器。例如,testteam@example.onmicrosoft.com将的编码版本看起来像testteam%40example.onmicrosoft.com,您的图形请求将是https://graph.microsoft.com/beta/groups/testteam%40example.onmicrosoft.com/threads

编辑:

在请求中,您需要使用组的ID。例如:获取组请求可能看起来像...,组 id 是c28c1cc9-e1ab-4c4d-98d1-d8fdf128b60f

https://graph.microsoft.com/v1,0/groups/c28c1cc9-e1ab-4c4d-98d1-d8fdf128b60f?$select=description,allowExternalSenders
于 2017-05-25T19:26:30.003 回答