Copilot 活動匯出 API 可讓您匯出 Copilot 互動資料,其中包括對 Copilot 的使用者提示,以及 Copilot 回應回使用者。 此 API 會擷取使用者意圖和 Copilot 存取的資源,以及跨 Microsoft 365 Copilot 應用程式 (例如 Teams、Word 和 Outlook) 的使用者回應。
如何存取 Copilot 活動匯出 API
範例 1 是一個簡單的查詢,用於擷取所有副手互動,無需任何篩選條件:
GET https://graph.microsoft.com/v1.0/copilot/users/{id}/interactionHistory/getAllEnterpriseInteractions範例 2 是擷取所有與 appclass 篩選的副手互動的簡單查詢:
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 的所有副手互動
- 需要 Microsoft 365 Copilot 授權 才能存取新的 Copilot 活動匯出 API。
支援的 appClass 篩選器:
支援下列 appClass 篩選:
IPM.SkypeTeams.Message.Copilot.WordIPM.SkypeTeams.Message.Copilot.ExcelIPM.SkypeTeams.Message.Copilot.TeamsIPM.SkypeTeams.Message.Copilot.BizChatIPM.SkypeTeams.Message.Copilot.WebChat
這些篩選條件可讓您根據應用程式類別指定要擷取的 Copilot 互動類型。 不支援其餘的互動。
深入瞭解 aiInteractionHistory:getAllEnterpriseInteractions ,可匯出副手互動。
已知問題:
對於 Teams 會議 Copilot 中的某些互動,互動中aiResponse可能會遺失 。contexts[] 不過,對應的使用者提示一律包含 , contexts[] 以確保內容擷取準確無誤。 開發團隊意識到了這個問題,並正在研究解決方案。 下列範例顯示使用者提示、aiResponse 配對,該配對在使用者提示中具有有效的 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 的節流限制,請參閱 Teams 匯出 API 節流限制。
- 不支援 Delta 函式呼叫。
- 為了獲得最佳效能,建議的$top值為 100。
- 此 API 可用來擷取已刪除使用者支援的 Copilot 互動。
- 可以使用此 API 擷取支援應用程式類別的已刪除副手互動。
- 如果編輯了使用者提示,則會將其視為新的互動,並可以使用此 API 進行擷取。