|
| 1 | +Show reported events |
| 2 | +==================== |
| 3 | + |
| 4 | +This API returns information about reported events. |
| 5 | + |
| 6 | +The api is:: |
| 7 | + |
| 8 | + GET /_synapse/admin/v1/event_reports?from=0&limit=10 |
| 9 | + |
| 10 | +To use it, you will need to authenticate by providing an ``access_token`` for a |
| 11 | +server admin: see `README.rst <README.rst>`_. |
| 12 | + |
| 13 | +It returns a JSON body like the following: |
| 14 | + |
| 15 | +.. code:: jsonc |
| 16 | +
|
| 17 | + { |
| 18 | + "event_reports": [ |
| 19 | + { |
| 20 | + "content": { |
| 21 | + "reason": "foo", |
| 22 | + "score": -100 |
| 23 | + }, |
| 24 | + "event_id": "$bNUFCwGzWca1meCGkjp-zwslF-GfVcXukvRLI1_FaVY", |
| 25 | + "event_json": { |
| 26 | + "auth_events": [ |
| 27 | + "$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M", |
| 28 | + "$oggsNXxzPFRE3y53SUNd7nsj69-QzKv03a1RucHu-ws" |
| 29 | + ], |
| 30 | + "content": { |
| 31 | + "body": "matrix.org: This Week in Matrix", |
| 32 | + "format": "org.matrix.custom.html", |
| 33 | + "formatted_body": "<strong>matrix.org</strong>:<br><a href=\"https://matrix.org/blog/\"><strong>This Week in Matrix</strong></a>", |
| 34 | + "msgtype": "m.notice" |
| 35 | + }, |
| 36 | + "depth": 546, |
| 37 | + "hashes": { |
| 38 | + "sha256": "xK1//xnmvHJIOvbgXlkI8eEqdvoMmihVDJ9J4SNlsAw" |
| 39 | + }, |
| 40 | + "origin": "matrix.org", |
| 41 | + "origin_server_ts": 1592291711430, |
| 42 | + "prev_events": [ |
| 43 | + "$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M" |
| 44 | + ], |
| 45 | + "prev_state": [], |
| 46 | + "room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org", |
| 47 | + "sender": "@foobar:matrix.org", |
| 48 | + "signatures": { |
| 49 | + "matrix.org": { |
| 50 | + "ed25519:a_JaEG": "cs+OUKW/iHx5pEidbWxh0UiNNHwe46Ai9LwNz+Ah16aWDNszVIe2gaAcVZfvNsBhakQTew51tlKmL2kspXk/Dg" |
| 51 | + } |
| 52 | + }, |
| 53 | + "type": "m.room.message", |
| 54 | + "unsigned": { |
| 55 | + "age_ts": 1592291711430, |
| 56 | + } |
| 57 | + }, |
| 58 | + "id": 2, |
| 59 | + "reason": "foo", |
| 60 | + "received_ts": 1570897107409, |
| 61 | + "room_alias": "#alias1:matrix.org", |
| 62 | + "room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org", |
| 63 | + "sender": "@foobar:matrix.org", |
| 64 | + "user_id": "@foo:matrix.org" |
| 65 | + }, |
| 66 | + { |
| 67 | + "content": { |
| 68 | + "reason": "bar", |
| 69 | + "score": -100 |
| 70 | + }, |
| 71 | + "event_id": "$3IcdZsDaN_En-S1DF4EMCy3v4gNRKeOJs8W5qTOKj4I", |
| 72 | + "event_json": { |
| 73 | + // hidden items |
| 74 | + // see above |
| 75 | + }, |
| 76 | + "id": 3, |
| 77 | + "reason": "bar", |
| 78 | + "received_ts": 1598889612059, |
| 79 | + "room_alias": "#alias2:matrix.org", |
| 80 | + "room_id": "!eGvUQuTCkHGVwNMOjv:matrix.org", |
| 81 | + "sender": "@foobar:matrix.org", |
| 82 | + "user_id": "@bar:matrix.org" |
| 83 | + } |
| 84 | + ], |
| 85 | + "next_token": 2, |
| 86 | + "total": 4 |
| 87 | + } |
| 88 | +
|
| 89 | +To paginate, check for ``next_token`` and if present, call the endpoint again |
| 90 | +with ``from`` set to the value of ``next_token``. This will return a new page. |
| 91 | + |
| 92 | +If the endpoint does not return a ``next_token`` then there are no more |
| 93 | +reports to paginate through. |
| 94 | + |
| 95 | +**URL parameters:** |
| 96 | + |
| 97 | +- ``limit``: integer - Is optional but is used for pagination, |
| 98 | + denoting the maximum number of items to return in this call. Defaults to ``100``. |
| 99 | +- ``from``: integer - Is optional but used for pagination, |
| 100 | + denoting the offset in the returned results. This should be treated as an opaque value and |
| 101 | + not explicitly set to anything other than the return value of ``next_token`` from a previous call. |
| 102 | + Defaults to ``0``. |
| 103 | +- ``dir``: string - Direction of event report order. Whether to fetch the most recent first (``b``) or the |
| 104 | + oldest first (``f``). Defaults to ``b``. |
| 105 | +- ``user_id``: string - Is optional and filters to only return users with user IDs that contain this value. |
| 106 | + This is the user who reported the event and wrote the reason. |
| 107 | +- ``room_id``: string - Is optional and filters to only return rooms with room IDs that contain this value. |
| 108 | + |
| 109 | +**Response** |
| 110 | + |
| 111 | +The following fields are returned in the JSON response body: |
| 112 | + |
| 113 | +- ``id``: integer - ID of event report. |
| 114 | +- ``received_ts``: integer - The timestamp (in milliseconds since the unix epoch) when this report was sent. |
| 115 | +- ``room_id``: string - The ID of the room in which the event being reported is located. |
| 116 | +- ``event_id``: string - The ID of the reported event. |
| 117 | +- ``user_id``: string - This is the user who reported the event and wrote the reason. |
| 118 | +- ``reason``: string - Comment made by the ``user_id`` in this report. May be blank. |
| 119 | +- ``content``: object - Content of reported event. |
| 120 | + |
| 121 | + - ``reason``: string - Comment made by the ``user_id`` in this report. May be blank. |
| 122 | + - ``score``: integer - Content is reported based upon a negative score, where -100 is "most offensive" and 0 is "inoffensive". |
| 123 | + |
| 124 | +- ``sender``: string - This is the ID of the user who sent the original message/event that was reported. |
| 125 | +- ``room_alias``: string - The alias of the room. ``null`` if the room does not have a canonical alias set. |
| 126 | +- ``event_json``: object - Details of the original event that was reported. |
| 127 | +- ``next_token``: integer - Indication for pagination. See above. |
| 128 | +- ``total``: integer - Total number of event reports related to the query (``user_id`` and ``room_id``). |
| 129 | + |
0 commit comments