25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

event_reports.md 6.4 KiB

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