Kanalnachrichten auflistenList channel messages
Namespace: microsoft.graphNamespace: microsoft.graph
Ruft die Liste der Nachrichten (ohne die Antworten) in einem Kanal eines Teams ab.Retrieve the list of messages (without the replies) in a channel of a team.
Um die Antworten für eine Nachricht abzurufen, rufen Sie die API zum Auflisten der Nachrichtenantworten oder die API zum Abrufen der Nachrichtenantwort auf.To get the replies for a message, call the list message replies or the get message reply API.
BerechtigungenPermissions
Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie im Artikel zum Thema Berechtigungen.One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
BerechtigungstypPermission Type | Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)Permissions (from least to most privileged) |
---|---|
Delegiert (Geschäfts-, Schul- oder Unikonto)Delegated (work or school account) | ChannelMessage.Read.AllChannelMessage.Read.All |
Delegiert (persönliches Microsoft-Konto)Delegated (personal Microsoft account) | Nicht unterstütztNot supported. |
AnwendungApplication | Nicht unterstütztNot supported. |
Hinweis : Mit * markierte Berechtigungen verwenden ressourcenspezifische Zustimmung.Note : Permissions marked with * use resource-specific consent.
Hinweis
Bevor Sie diese API mit Anwendungsberechtigungen aufrufen, müssen Sie Zugriff anfordern.Before calling this API with application permissions, you must request access. Ausführliche Informationen finden Sie unter Geschützte APIs in Microsoft Teams.For details, see Protected APIs in Microsoft Teams.
HTTP-AnforderungHTTP request
GET /teams/{id}/channels/{id}/messages
Optionale AbfrageparameterOptional query parameters
Sie können den $top-Abfrageparameter verwenden, um die Anzahl der Elemente pro Antwort zu kontrollieren.You can use the $top query parameter to control the number of items per response. Die anderen OData-Abfrageparameter werden derzeit nicht unterstützt.The other OData query parameters are not currently supported.
Hinweis: GET /teams/{id}/channels/{id}/messages/delta unterstützt das Filtern nach Datum, das ähnliche Daten zu GET /teams/{id}/channels/{id}/messages bietet.Note: GET /teams/{id}/channels/{id}/messages/delta supports filtering by date, which provides similar data to GET /teams/{id}/channels/{id}/messages.
AnforderungsheaderRequest headers
KopfzeileHeader | WertValue |
---|---|
AuthorizationAuthorization | Bearer {token}. Erforderlich.Bearer {token}. Required. |
AnforderungstextRequest body
Geben Sie für diese Methode keinen Anforderungstext an.Do not supply a request body for this method.
AntwortResponse
Wenn die Methode erfolgreich verläuft, werden der Antwortcode 200 OK
und eine Sammlung von chatMessage-Objekten im Antworttext zurückgegeben.If successful, this method returns a 200 OK
response code and a collection of chatMessage objects in the response body.
BeispielExample
AnforderungRequest
Nachfolgend sehen Sie ein Beispiel der Anforderung.Here is an example of the request.
GET https://graph.microsoft.com/v1.0/teams/303d2c1c-f1c5-40ce-b68e-544343d7f42b/channels/19:fec4b0f2825d4c8c82abc09027a64184@thread.skype/messages
AntwortResponse
Nachfolgend sehen Sie ein Beispiel der Antwort.Here is an example of the response.
Hinweis: Das hier gezeigte Antwortobjekt wurde möglicherweise zur besseren Lesbarkeit gekürzt. Ein tatsächlicher Aufruf gibt alle Eigenschaften zurück.Note: The response object shown here might be shortened for readability. All the properties will be returned from an actual call.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('303d2c1c-f1c5-40ce-b68e-544343d7f42b')/channels('19%3Afec4b0f2825d4c8c82abc09027a64184%40thread.skype')/messages",
"@odata.count": 3,
"value": [
{
"id": "1555375673184",
"replyToId": null,
"etag": "1555375673184",
"messageType": "message",
"createdDateTime": "2019-04-16T00:47:53.184Z",
"lastModifiedDateTime": "2019-05-04T19:58:15.511Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": "",
"summary": null,
"importance": "normal",
"locale": "en-us",
"policyViolation": null,
"from": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "bb8775a4-4d8c-42cf-a1d4-4d58c2bb668f",
"displayName": "Adele Vance",
"userIdentityType": "aadUser"
}
},
"body": {
"contentType": "html",
"content": "<div><div>Nice to join this team. <at id=\"0\">Megan Bowen</at>, have we got the March report ready please?</div>\n</div>"
},
"attachments": [],
"mentions": [
{
"id": 0,
"mentionText": "Megan Bowen",
"mentioned": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "5d8d505c-864f-4804-88c7-4583c966cde8",
"displayName": "Megan Bowen",
"userIdentityType": "aadUser"
}
}
}
],
"reactions": []
},
{
"id": "1548100551644",
"replyToId": null,
"etag": "1548100551893",
"messageType": "message",
"createdDateTime": "2019-01-21T19:55:51.644Z",
"lastModifiedDateTime": "2019-05-04T19:58:15.511Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": "",
"summary": null,
"importance": "normal",
"locale": "en-us",
"policyViolation": null,
"from": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "c651e5be-7631-42ad-99c6-12c59def11fb",
"displayName": "Miriam Graham",
"userIdentityType": "aadUser"
}
},
"body": {
"contentType": "html",
"content": "<div>I've added an Excel tab to the channel containing the P&L Summary. \r\n<div style=\"display:inline\"><at id=\"0\">Isaiah Langer</at></div> and team, please review the Sale Summary tab in particular, and make any necessary updates.</div>"
},
"attachments": [],
"mentions": [
{
"id": 0,
"mentionText": "Isaiah Langer",
"mentioned": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "b525e831-bd00-45e5-860c-a4329ef5f5d8",
"displayName": "Isaiah Langer",
"userIdentityType": "aadUser"
}
}
}
],
"reactions": [
{
"reactionType": "like",
"createdDateTime": "2019-01-21T19:55:51.893Z",
"user": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "e1ecb745-c10f-40af-a9d4-cab946c80ac7",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
]
},
{
"id": "1548100547534",
"replyToId": null,
"etag": "1548100547534",
"messageType": "message",
"createdDateTime": "2019-01-21T19:55:47.534Z",
"lastModifiedDateTime": "2019-05-04T19:58:15.511Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": "",
"summary": null,
"importance": "high",
"locale": "en-us",
"policyViolation": null,
"from": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "bb8775a4-4d8c-42cf-a1d4-4d58c2bb668f",
"displayName": "Adele Vance",
"userIdentityType": "aadUser"
}
},
"body": {
"contentType": "html",
"content": "<div>Just a reminder to everyone to please update your monthly reports by this Friday!</div>"
},
"attachments": [],
"mentions": [],
"reactions": []
}
]
}