Copilot 活動匯出 API 可讓您匯出 Copilot 互動資料,其中包括使用者提示給 Copilot,以及 Copilot 回應給使用者。 此 API 會跨 Teams、Word 和 Outlook 等 Microsoft Copilot 應用程式擷取使用者意圖和 Copilot 存取資源以及回應給使用者。
如何存取 Copilot 活動匯出 API
範例 1 是一個簡單的查詢,用於擷取所有 Copilot 互動,但不含任何篩選:
GET https://graph.microsoft.com/v1.0/copilot/users/{id}/interactionHistory/getAllEnterpriseInteractions範例 2 是一個簡單的查詢,可擷取所有與 appclass 篩選器的 Copilot 互動:
GET https://graph.microsoft.com/v1.0/copilot/users/{id}/interactionHistory/getAllEnterpriseInteractions?$filter=appClass eq 'IPM.SkypeTeams.Message.Copilot.Teams or appClass eq 'IPM.SkypeTeams.Message.Copilot.BizChat'
存取 Copilot 活動匯出 API 的必要條件
應用程式權限可由在沒有登入使用者的情況下執行的應用程式使用。 只有系統管理員可以核准應用程式權限。 需要下列權限:
- AiEnterpriseInteraction.Read.All:可讓您存取跨 Microsoft 365 應用程式和 Microsoft 365 Chat 的所有 Copilot 互動
- 存取新的 Microsoft Copilot 活動匯出 API 需要 Microsoft Copilot 授權。
支援的 appClass 篩選
支援下列 appClass 篩選:
IPM.SkypeTeams.Message.Copilot.WordIPM.SkypeTeams.Message.Copilot.ExcelIPM.SkypeTeams.Message.Copilot.TeamsIPM.SkypeTeams.Message.Copilot.BizChatIPM.SkypeTeams.Message.Copilot.WebChatIPM.SkypeTeams.Message.Copilot.CoworkChat
這些篩選可讓您指定根據應用程式類別要擷取的 Copilot 互動類型。 不支援其餘互動。
深入了解可匯出 Copilot 互動的 aiInteractionHistory: getAllEnterpriseInteractions 。
已知問題
針對 Teams Meeting Copilot 中的某些互動, contexts[] 互動中 aiResponse 可能會遺失 。 不過,對應的使用者提示一律會包含 , contexts[] 以確保內容擷取準確無誤。 開發團隊已發現此問題,並正在研究解決方案。 下列範例顯示 userprompt、aiResponse 配對,其在 userprompt 中有有效的 contexts[],而在對應的 aiResponse 中缺少 contexts[]。
[
{
"id": "1746757256660",
"sessionId": "19:-SMwOyVjy2H3_BnsIO6WGUTXwuN1_BIw4U2TP4UcCwo1@thread.v2",
"requestId": "db42bee0-7cfb-451f-8eb6-f929762ee970",
"appClass": "IPM.SkypeTeams.Message.Copilot.Teams",
"interactionType": "userPrompt",
"conversationType": "appchat",
"etag": "1746757256660",
"createdDateTime": "2025-05-09T02:20:56.66Z",
"locale": "en-us",
"contexts": [
{
"contextReference": "https://microsoft.teams.com/threads/19:meeting_MTQ4ZDdkMzktYjhkZC00ODdlLTkwN2UtYzcwYjVmOWIxYTNm@thread.v2",
"displayName": "Teams Meeting Copilot",
"contextType": "TeamsMeeting"
}
],
"from": {
"@odata.type": "#microsoft.graph.chatMessageFromIdentitySet",
"application": null,
"device": null,
"user": {
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
"id": "886cb6c8-eb73-4f72-ad99-69ebf43f70ad",
"displayName": "8:orgid:886cb6c8-eb73-4f72-ad99-69ebf43f70ad",
"userIdentityType": "aadUser",
"tenantId": "bcefad10-7e12-4123-8457-f3ac71b098db"
}
},
"body": {
"contentType": "text",
"content": "what was this meeting about?<attachment id=\"19:meeting_MTQ4ZDdkMzktYjhkZC00ODdlLTkwN2UtYzcwYjVmOWIxYTNm@thread.v2\"></attachment>"
},
"attachments": [
{
"attachmentId": "19:meeting_MTQ4ZDdkMzktYjhkZC00ODdlLTkwN2UtYzcwYjVmOWIxYTNm@thread.v2",
"contentType": "reference",
"contentUrl": "https://microsoft.teams.com/threads/19:meeting_MTQ4ZDdkMzktYjhkZC00ODdlLTkwN2UtYzcwYjVmOWIxYTNm@thread.v2",
"content": null,
"name": "Teams Meeting Copilot"
}
],
"links": [],
"mentions": []
},
{
"id": "1746757257162",
"sessionId": "19:-SMwOyVjy2H3_BnsIO6WGUTXwuN1_BIw4U2TP4UcCwo1@thread.v2",
"requestId": "db42bee0-7cfb-451f-8eb6-f929762ee970",
"appClass": "IPM.SkypeTeams.Message.Copilot.Teams",
"interactionType": "aiResponse",
"conversationType": "appchat",
"etag": "1746757257162",
"createdDateTime": "2025-05-09T02:20:57.162Z",
"locale": "en-us",
"contexts": [],
"from": {
"@odata.type": "#microsoft.graph.chatMessageFromIdentitySet",
"device": null,
"user": null,
"application": {
"@odata.type": "#microsoft.graph.teamworkApplicationIdentity",
"id": "fb8d773d-7ef8-4ec0-a117-179f88add510",
"displayName": "Copilot in Teams",
"applicationIdentityType": "bot"
}
},
"body": {
"contentType": "text",
"content": "I need to hear more discussion before I can get to work. Please try again in a few minutes."
},
"attachments": [],
"links": [],
"mentions": []
}
]
不在 Copilot 互動匯出 API 的範圍內:
- 不支援 Delta 函數呼叫。
- Copilot 互動匯出 API 回應中不包含特定 Copilot 產生的簡報中繼資料。 不包含下列中繼資料:
- 可編輯的 Copilot Microsoft 365 聊天顯示名稱。
- 由 Copilot 自動產生或建議的 Outlook 郵件主旨行。
備註
- 若要瞭解 Copilot 互動匯出 API 的節流限制,請參閱 Teams 匯出 API 節流限制。
- 為獲得最佳效能,建議的$top值為 100。
- 此 API 可用來擷取已刪除使用者支援的 Copilot 互動。
- 您可以使用此 API 擷取支援的應用程式類別的已刪除 Copilot 互動。
- 如果編輯使用者提示,則會將其視為新的互動,並可使用此 API 擷取。