From 6d4ab8fb90ae2eaa3393dcbd37c83c486202b347 Mon Sep 17 00:00:00 2001 From: DMRobertson Date: Tue, 27 Sep 2022 12:50:14 +0000 Subject: deploy: 3853011d01ad3f5034f53a9dfb7a06e36cf70ae9 --- latest/admin_api/rooms.html | 127 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) (limited to 'latest/admin_api/rooms.html') diff --git a/latest/admin_api/rooms.html b/latest/admin_api/rooms.html index 12a1c436b9..d3fc9e7f14 100644 --- a/latest/admin_api/rooms.html +++ b/latest/admin_api/rooms.html @@ -504,6 +504,133 @@ If the room does not define a type, the value will be null. ] } +

Room Messages API

+

The Room Messages admin API allows server admins to get all messages +sent to a room in a given timeframe. There are various parameters available +that allow for filtering and ordering the returned list. This API supports pagination.

+

To use it, you will need to authenticate by providing an access_token +for a server admin: see Admin API.

+

This endpoint mirrors the Matrix Spec defined Messages API.

+

The API is:

+
GET /_synapse/admin/v1/rooms/<room_id>/messages
+
+

Parameters

+

The following path parameters are required:

+ +

The following query parameters are available:

+ +

Response

+

The following fields are possible in the JSON response body:

+ +

Example

+

For more details on each chunk, read the Matrix specification.

+
{
+  "chunk": [
+    {
+      "content": {
+        "body": "This is an example text message",
+        "format": "org.matrix.custom.html",
+        "formatted_body": "<b>This is an example text message</b>",
+        "msgtype": "m.text"
+      },
+      "event_id": "$143273582443PhrSn:example.org",
+      "origin_server_ts": 1432735824653,
+      "room_id": "!636q39766251:example.com",
+      "sender": "@example:example.org",
+      "type": "m.room.message",
+      "unsigned": {
+        "age": 1234
+      }
+    },
+    {
+      "content": {
+        "name": "The room name"
+      },
+      "event_id": "$143273582443PhrSn:example.org",
+      "origin_server_ts": 1432735824653,
+      "room_id": "!636q39766251:example.com",
+      "sender": "@example:example.org",
+      "state_key": "",
+      "type": "m.room.name",
+      "unsigned": {
+        "age": 1234
+      }
+    },
+    {
+      "content": {
+        "body": "Gangnam Style",
+        "info": {
+          "duration": 2140786,
+          "h": 320,
+          "mimetype": "video/mp4",
+          "size": 1563685,
+          "thumbnail_info": {
+            "h": 300,
+            "mimetype": "image/jpeg",
+            "size": 46144,
+            "w": 300
+          },
+          "thumbnail_url": "mxc://example.org/FHyPlCeYUSFFxlgbQYZmoEoe",
+          "w": 480
+        },
+        "msgtype": "m.video",
+        "url": "mxc://example.org/a526eYUSFFxlgbQYZmo442"
+      },
+      "event_id": "$143273582443PhrSn:example.org",
+      "origin_server_ts": 1432735824653,
+      "room_id": "!636q39766251:example.com",
+      "sender": "@example:example.org",
+      "type": "m.room.message",
+      "unsigned": {
+        "age": 1234
+      }
+    }
+  ],
+  "end": "t47409-4357353_219380_26003_2265",
+  "start": "t47429-4392820_219380_26003_2265"
+}
+
+

Room Timestamp to Event API

+

The Room Timestamp to Event API endpoint fetches the event_id of the closest event to the given +timestamp (ts query parameter) in the given direction (dir query parameter).

+

Useful for cases like jump to date so you can start paginating messages from +a given date in the archive.

+

The API is:

+
  GET /_synapse/admin/v1/rooms/<room_id>/timestamp_to_event
+
+

Parameters

+

The following path parameters are required:

+ +

The following query parameters are available:

+ +

Response

+

Block Room API

The Block Room admin API allows server admins to block and unblock rooms, and query to see if a given room is blocked. -- cgit 1.5.1