Preview unavailableThe idea behind the sample
Work IQ Answers sends the user's natural-language question to the Work IQ Chat API and renders the response as structured UI instead of plain text. The people, meetings, and files that Work IQ tags inline in its answer become clickable chips, and every citation it returns is grouped into a source panel that deep-links into Teams, SharePoint, or a person's profile. Follow-up questions reuse the same conversation, so multi-turn works as the API intends.
The sample is the only one in this repository that calls Work IQ rather than Microsoft Graph, and it demonstrates the SPFx AadHttpClient pattern for a non-Graph Entra-secured API: a single webApiPermissionRequests entry for the delegated WorkIQAgent.Ask permission, approved once by a tenant admin, with no middle tier and no client secret.
It ships with useMock enabled, so the full experience (inline card, fullscreen view, grouped sources, entity chips, sensitivity badge) runs with zero live dependencies. The mock responses are the exact wire shape of the real API and flow through the same parsing code, so switching to the live endpoint changes no UI code.
Make it your own
Start with the author's setup instructions, explore the implementation, and adapt the pattern to your environment. Sample code stays in its original repository, together with its requirements, license and contribution history.
Read the source documentationKeep exploring
- Work IQ REST API overview — Multi-turn conversations with Microsoft Copilot over HTTP, with enterprise and web search grounding.
- Work IQ - copilotConversation: chat — The chat endpoint used by this sample, including the attributions and sensitivityLabel response shapes.
- Connect to Entra ID-secured APIs in SharePoint Framework solutions — How webApiPermissionRequests and AadHttpClient let an SPFx solution call a non-Graph Entra-secured API without a middle tier.
- Build agents for Microsoft Copilot — Extend Microsoft Copilot with declarative agents, plugins, and connectors to tailor Copilot to your organization's needs.
- Overview of the SharePoint Framework — The SharePoint Framework (SPFx) is a page and web part model that provides full support for client-side SharePoint development.
