Arbeits-IQ - copilotKonversation: chat

Wichtig

APIs unter der /beta Version können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt.

Mit der Work IQ Chat-API können Sie mehrteilige Unterhaltungen mit Microsoft 365 Copilot erstellen und fortsetzen und dabei die definierten Zugriffskontrollen innerhalb der organization einhalten. Verwenden Sie die Chat-API, um synchrone Unterhaltungen mit Microsoft 365 Copilot fortzusetzen.

In dieser Dokumentation werden fortgesetzte synchrone Copilot-Unterhaltungen mithilfe der Chat-API behandelt. Erfahren Sie, wie Sie Copilot-Unterhaltungen erstellen oder gestreamte Unterhaltungen mit der Chat-API fortsetzen.

Berechtigungen

Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.

Berechtigungstyp Berechtigungen mit den geringsten Berechtigungen Berechtigungen mit höheren Berechtigungen
Delegiert (Geschäfts-, Schul- oder Unikonto) WorkIQAgent.Ask Nicht verfügbar.
Delegiert (persönliches Microsoft-Konto) Nicht unterstützt Nicht unterstützt
Application Nicht unterstützt Nicht unterstützt

HTTP-Anforderung

POST https://workiq.svc.cloud.microsoft/rest/conversations/{conversationId}/chat
POST https://workiq.svc.cloud.microsoft/rest/beta/conversations/{conversationId}/chat

Anforderungsheader

Name Beschreibung
Authorization Bearer {token}. Erforderlich. Erfahren Sie mehr über Authentifizierung und Autorisierung.
Content-Type application/json. Erforderlich.

Anforderungstext

Geben Sie im Anforderungstext eine JSON-Darstellung der Parameter an.

In der folgenden Tabelle sind die optionalen und erforderlichen Parameter aufgeführt, die Sie beim Aufrufen dieser Aktion verwenden können.

Parameter Typ Beschreibung
message copilotConversationRequestMessageParameter Die Chatnachricht, die in die Copilot-Unterhaltung gesendet wird. Erforderlich.
additionalContext copilotContextMessage-Sammlung Zusätzlicher Kontext für das Copilot-Gespräch. Dies sollte zur zusätzlichen Erdung verwendet werden. Optional.
locationHint copilotConversationLocation Informationen zum Standort des Benutzers. Erforderlich.
contextualResources copilotContextualResources Stellt OneDrive- und SharePoint-Dateien bereit, die als Kontext verwendet werden sollen, und/oder schaltet die Grundlage für die Websuche um. Optional.

Antwort

Bei erfolgreicher Ausführung gibt diese Aktion einen 200 OK Antwortcode und eine copilotConversation im Antworttext zurück.

Beispiele

Beispiel 1: Senden einer Chatnachricht

Im folgenden Beispiel wird gezeigt, wie Sie mithilfe des synchronen Endpunkts eine Eingabeaufforderung an die Chat-API senden.

Anforderung

Das folgende Beispiel zeigt die Antwort. ▶ Öffnen Sie diesen vorausgefüllten Prompt in der interaktiven Demo.

POST https://workiq.svc.cloud.microsoft/rest/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "What meeting do I have at 9 AM tomorrow morning?"
  },
  "locationHint": {
    "timeZone": "America/New_York"
  }
}
POST https://workiq.svc.cloud.microsoft/rest/beta/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "What meeting do I have at 9 AM tomorrow morning?"
  },
  "locationHint": {
    "timeZone": "America/New_York"
  }
}

Antwort

Das folgende Beispiel zeigt die Antwort.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "0d110e7e-2b7e-4270-a899-fd2af6fde333",
  "createdDateTime": "2025-09-30T15:55:53.4711746Z",
  "displayName": "What meeting do I have at 9 AM tomorrow morning?",
  "state": "active",
  "turnCount": 1,
  "messages": [
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "cc211f56-1a5e-0af0-fec2-c354ce468b95",
      "text": "What meeting do I have at 9 AM tomorrow morning?",
      "createdDateTime": "2025-09-30T15:55:53.4711746Z",
      "adaptiveCards": [],
      "attributions": [],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    },
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "3fe6b260-c682-4f8e-a201-022ccb300742",
      "text": "You asked about your meeting scheduled for **9 AM tomorrow**, and I found **1 meeting** on your calendar.\n\n### 📅 Tomorrow at 9 AM\n- **Meeting**: <Event>Contoso Engineering Standup</Event>\n- **Organizer**: <Person>John Doe</Person>[^1^]\n- **Time**: 9:00 AM – 9:30 AM\n- **Location**: Microsoft Teams Meeting\n- **Status**: No one has accepted the invite yet[^1^]\n\nLet me know if you'd like help preparing for this meeting or checking who else was invited.",
      "createdDateTime": "2025-09-30T15:55:58.9856658Z",
      "adaptiveCards": [
        {}
      ],
      "attributions": [
        {
          "attributionType": "annotation",
          "providerDisplayName": "",
          "attributionSource": "model",
          "seeMoreWebUrl": "https://teams.microsoft.com/l/meeting/details?eventId=BBMkADg5ZjdjZGNiLWRiMzItNDA3MC1iNDNlLTdlMGY4ZDc0ZjdlZgBGAAAAAACm2kxZvrUtTa-iv1uzeNCxBwA4nsl0tFf4R7qmHdVqpNbsAAAAAAENAAA4nsl0tFf4R7qmHdVqpNbsAAAVa4BBAAA%3d&EntityRepresentationId=988db526-6e9b-46ec-906e-3fba32438e5d",
          "imageWebUrl": "",
          "imageFavIcon": "",
          "imageWidth": 0,
          "imageHeight": 0
        },
        {
          "attributionType": "annotation",
          "providerDisplayName": "",
          "attributionSource": "model",
          "seeMoreWebUrl": "https://www.office.com/search?q=John+Doe&EntityRepresentationId=g38b20af-0d21-47fd-8e45-fd9d55215cb3",
          "imageWebUrl": "",
          "imageFavIcon": "",
          "imageWidth": 0,
          "imageHeight": 0
        },
        {
          "attributionType": "citation",
          "providerDisplayName": "Contoso Engineering Standup",
          "attributionSource": "model",
          "seeMoreWebUrl": "https://teams.microsoft.com/l/meeting/details?eventId=BBMkADg5ZjdjZGNiLWRiMzItNDA3MC1iNDNlLTdlMGY4ZDc0ZjdlZgBGAAAAAACm2kxZvrUtTa-iv1uzeNCxBwA4nsl0tFf4R7qmHdVqpNbsAAAAAAENAAA4nsl0tFf4R7qmHdVqpNbsAAAVa4BBAAA%3d",
          "imageWebUrl": "",
          "imageFavIcon": "",
          "imageWidth": 0,
          "imageHeight": 0
        }
      ],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    }
  ]
}

Beispiel 2: Verwenden einer OneDrive- oder SharePoint-Datei als Kontext in einer Chatnachricht

Das folgende Beispiel zeigt, wie Sie eine OneDrive- oder SharePoint-Datei als Kontext verwenden, wenn Sie eine Nachricht an die Chat-API senden. Beim Senden einer Chatnachricht können mehrere OneDrive- und SharePoint-Dateien als Kontext verwendet werden.

Anforderung

Das folgende Beispiel zeigt die Antwort.

POST https://workiq.svc.cloud.microsoft/rest/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "Summarize this document for me."
  },
  "locationHint": {
    "timeZone": "America/New_York"
  },
  "contextualResources": {
    "files": [
      {
        "uri": "https://contoso.sharepoint.com/sites/Engineering/Shared%20Documents/Specs/Business-Model.docx"
      }
    ]
  }
}
POST https://workiq.svc.cloud.microsoft/rest/beta/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "Summarize this document for me."
  },
  "locationHint": {
    "timeZone": "America/New_York"
  },
  "contextualResources": {
    "files": [
      {
        "uri": "https://contoso.sharepoint.com/sites/Engineering/Shared%20Documents/Specs/Business-Model.docx"
      }
    ]
  }
}

Antwort

Das folgende Beispiel zeigt die Antwort.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "0d110e7e-2b7e-4270-a899-fd2af6fde333",
  "createdDateTime": "2025-09-30T16:15:13.0889735Z",
  "displayName": "What meeting do I have at 9 AM tomorrow morning?",
  "state": "active",
  "turnCount": 2,
  "messages": [
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "7b9f74b6-673a-7077-d29e-5ef8a6c6968c",
      "text": "Summarize this document for me.",
      "createdDateTime": "2025-09-30T16:15:13.0889735Z",
      "adaptiveCards": [],
      "attributions": [],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    },
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "85e25e6e-4218-40fb-91a3-897d555d18d0",
      "text": "You asked for a summary of the document \"<File>Business-Model.docx</File>\". Here's a concise overview based on its content:\n\n---\n\n## **Summary: What Is a Business Model?**\n\n### **Definition & Importance**\n- A business model is a holistic framework for creating, delivering, and capturing value. It's not just about monetization, but about how an organization systematically unlocks long-term value for itself and its customers.\n- Business models are essential for startups and established companies alike, as they guide value creation, customer engagement, and sustainable growth.\n\n### **Key Concepts**\n- **Business Model vs. Business Plan:** A business model is about experimentation and testing assumptions in the real world, while a business plan is a static document with projections that are often untested.\n- **Business Model vs. Revenue Strategy:** Monetization is just one part of a business model. A true business model also covers operations, customer acquisition, retention, supply chain, and more.\n\n### **Design & Innovation**\n- Business model design is about building a sustainable value chain, starting with a clear value proposition and focusing on key stakeholders.\n- Innovation in business models can be more disruptive than technological innovation. Companies like Company1, Company2, and Company3 succeeded by innovating their business models, not just their technology.\n- Competitive advantages (or \"moats\") are often built around innovative business models, especially in the digital era.\n\n### **Experimentation**\n- Business modeling is an iterative process, much like scientific experimentation. Entrepreneurs must test, adapt, and refine their models to find what works in the marketplace.\n\n### **Frameworks**\n- **Business Model Canvas:** A popular tool that breaks down a business model into key partners, activities, value propositions, customer relationships, segments, resources, channels, cost structure, and revenue streams.\n- **Lean Startup Canvas:** Focuses on experimentation, customer feedback, and iterative design, especially for startups.\n\n### **Components (FourWeekMBA Perspective)**\n- **People Dimension:** Value proposition, brand positioning, and ambitious goal setting.\n- **Financial Dimension:** Customer segments, distribution channels, and profit formula.\n\n### **Types of Business Models**\nThe document details 30+ business model types, including:\n- Asymmetric (hidden revenue, e.g., Company1, Company4)\n- One-for-one (e.g., Company5)\n- Razor and blade (e.g., Company6)\n- Peer-to-peer (e.g., Company7)\n- Multi-sided platforms (e.g., Company8)\n- Freemium, subscription, affiliate, consulting, agency, vertically integrated, e-commerce marketplace, discount, attention merchant, privacy-focused, franchising, on-demand, user-generated content, educational niche, chain/franchise mix, instant news, blockchain-based, multi-brand, family-owned, humanist enterprise, direct-to-consumer, enterprise/complex sales, distribution-based, and more.\n\n### **Key Takeaways**\n- There is no single best business model; success depends on context, timing, and market conditions.\n- Business models must evolve with changing technologies and market needs.\n- Experimentation, adaptability, and a clear value proposition are critical for long-term success.\n\n---\n\nIf you'd like a deeper dive into any specific section or business model type from the document, just let me know!",
      "createdDateTime": "2025-09-30T16:15:25.509337Z",
      "adaptiveCards": [
        {}
      ],
      "attributions": [
        {
          "attributionType": "annotation",
          "providerDisplayName": "",
          "attributionSource": "model",
          "seeMoreWebUrl": "https://contoso.sharepoint.com/sites/Engineering/Shared%20Documents/Specs/Business-Model.docx",
          "imageWebUrl": "",
          "imageFavIcon": "",
          "imageWidth": 0,
          "imageHeight": 0
        },
        {
          "attributionType": "citation",
          "providerDisplayName": "529425287-What-Is-a-Business-Model",
          "attributionSource": "grounding",
          "seeMoreWebUrl": "https://contoso.sharepoint.com/sites/Engineering/Shared%20Documents/Specs/Business-Model.docx",
          "imageWebUrl": "",
          "imageFavIcon": "",
          "imageWidth": 0,
          "imageHeight": 0
        }
      ],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    }
  ]
}

Beispiel 3: Deaktivieren der Websuche beim Senden einer Chatnachricht

Das folgende Beispiel zeigt, wie Sie die Grundlage der Websuche beim Senden einer Chatnachricht an die Chat-API deaktivieren. Wenn die Grundlage der Websuche deaktiviert ist, wird nur die Grundlage für die Unternehmenssuche verwendet, um eine Chatnachricht zu beantworten. Das Umschalten der Websuchgrundlage ist eine Aktion in einer einzigen Runde.

Anforderung

Das folgende Beispiel zeigt die Antwort.

POST https://workiq.svc.cloud.microsoft/rest/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "What is the highest grossing movie at the global box office this year?"
  },
  "locationHint": {
    "timeZone": "America/New_York"
  },
  "contextualResources": {
    "webContext": {
      "isWebEnabled": false
    }
  }
}
POST https://workiq.svc.cloud.microsoft/rest/beta/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "What is the highest grossing movie at the global box office this year?"
  },
  "locationHint": {
    "timeZone": "America/New_York"
  },
  "contextualResources": {
    "webContext": {
      "isWebEnabled": false
    }
  }
}

Antwort

Das folgende Beispiel zeigt die Antwort.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "0d110e7e-2b7e-4270-a899-fd2af6fde333",
  "createdDateTime": "2025-09-30T20:54:38.6856711Z",
  "displayName": "What meeting do I have at 9 AM tomorrow morning?",
  "state": "active",
  "turnCount": 3,
  "messages": [
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "40ec0e9f-d46a-0d57-a3c4-7342d86929d9",
      "text": "What is the highest grossing movie at the global box office this year?",
      "createdDateTime": "2025-09-30T20:54:38.6856711Z",
      "adaptiveCards": [],
      "attributions": [],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    },
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "9c0a96b9-ccf1-4a50-82ca-1ef7c2776c54",
      "text": "You asked: **What is the highest grossing movie at the global box office this year?**\n\nCurrently, I do not have access to real-time web search or external box office databases, and there are no internal enterprise documents or files provided that contain this information. As a result, I cannot provide the latest global box office data for this year.\n\n**How you can find this information:**\n- The most reliable sources for up-to-date box office rankings are websites like Source1, Source2, or Source3. These sites regularly update global box office statistics and highlight the top-grossing films of the year.\n\nIf you have a specific internal report or file related to box office performance, please let me know where to find it, and I'll be happy to summarize the relevant details for you! Would you like tips on how to track box office trends or insights into recent movie industry performance?",
      "createdDateTime": "2025-09-30T20:54:45.2785423Z",
      "adaptiveCards": [
        {}
      ],
      "attributions": [],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    }
  ]
}

Beispiel 4: Senden von zusätzlichem Kontext mit einer Chatnachricht

Im folgenden Beispiel wird gezeigt, wie Sie mehr Kontext mit einer Chatnachricht an die Chat-API senden. Dieser zusätzliche Kontext bietet der Chat-API eine Grundlage, um sie zu analysieren, z. B. Auszüge aus Dokumenten, Artikeln oder Websites.

Anforderung

Das folgende Beispiel zeigt die Antwort.

POST https://workiq.svc.cloud.microsoft/rest/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "What is the birthday of my best friend, John Doe?"
  },
  "additionalContext": [
    {
      "text": "John Doe's birthday is on January 1st."
    }
  ],
  "locationHint": {
    "timeZone": "America/New_York"
  }
}
POST https://workiq.svc.cloud.microsoft/rest/beta/conversations/0d110e7e-2b7e-4270-a899-fd2af6fde333/chat
Content-Type: application/json

{
  "message": {
    "text": "What is the birthday of my best friend, John Doe?"
  },
  "additionalContext": [
    {
      "text": "John Doe's birthday is on January 1st."
    }
  ],
  "locationHint": {
    "timeZone": "America/New_York"
  }
}

Antwort

Das folgende Beispiel zeigt die Antwort.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "0d110e7e-2b7e-4270-a899-fd2af6fde333",
  "createdDateTime": "2025-09-30T21:00:22.9880382Z",
  "displayName": "What meeting do I have at 9 AM tomorrow morning?",
  "state": "active",
  "turnCount": 4,
  "messages": [
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "70894d7b-94b2-d65a-f4ed-7f7b10f63737",
      "text": "What is the birthday of my best friend, John Doe?",
      "createdDateTime": "2025-09-30T21:00:22.9880382Z",
      "adaptiveCards": [],
      "attributions": [],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    },
    {
      "@odata.type": "#microsoft.graph.copilotConversationResponseMessage",
      "id": "65b34190-40d2-4933-9539-8324684aca5a",
      "text": "You asked for the birthday of your best friend, <Person>John Doe</Person>.\n\nBased on the information available, <Person>John Doe</Person>'s birthday is on **January 1st**. If you need this added to your calendar or want a reminder set up, just let me know!",
      "createdDateTime": "2025-09-30T21:00:26.9371633Z",
      "adaptiveCards": [
        {}
      ],
      "attributions": [],
      "sensitivityLabel": {
        "sensitivityLabelId": null,
        "displayName": null,
        "tooltip": null,
        "priority": null,
        "color": null,
        "isEncrypted": null
      }
    }
  ]
}