Retrieves all the reported messages grouped by users. It supports the #pagination parameters.
{% hint style="info" %}
It requires the view-moderation-console
permission.
{% endhint %}
URL | Requires Auth | HTTP Method |
---|---|---|
/api/v1/moderation.reportsByUsers |
yes |
GET |
Argument | Example | Required | Description |
---|---|---|---|
X-User-Id | myuser-name | Required | The authenticated user ID. |
X-Auth-Token | myauth-token | Required | Auth token. |
Argument | Example | Required | Description |
---|---|---|---|
oldest | 2021-09-30T09:33:15.621Z | Optional | It represents the oldest point in time for which you want to retrieve moderation reports |
latest | 2023-08-30T09:33:15.621Z | Optional | It represents the oldest point in time for which you want to retrieve moderation reports |
curl --location 'http://localhost:3000/api/v1/moderation.reportsByUsers' \
--header 'x-auth-token: aEO8Hw3zorBFQtAEYsNPnr67Li9-lY5kX1foen8UiiS' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ' \
--data ''
{
"reports": [
{
"rooms": [
{
"_id": "6423ce62c29657e5b3ba2675rbAXPnMktTFbNpwtJ",
"t": "d",
"federated": true
}
],
"count": 1,
"message": "hi",
"msgId": "tDNLALSFk2LET2JZH",
"ts": "2023-08-30T09:38:38.792Z",
"username": "funke.olasupo",
"name": "Funke Olasupo",
"userId": "rbAXPnMktTFbNpwtJ",
"isUserDeleted": false
},
{
"rooms": [
{
"_id": "5fRTXMt7DMJbpPJfhrbAXPnMktTFbNpwtJ",
"t": "d"
}
],
"count": 2,
"message": "himm",
"msgId": "xY8cN7yuPQfBgJ9xz",
"ts": "2023-08-30T09:33:15.621Z",
"username": "test.funke",
"name": "TestFunke",
"userId": "5fRTXMt7DMJbpPJfh",
"isUserDeleted": false
}
],
"count": 2,
"offset": 0,
"total": 3,
"success": true
}
Any of the following errors can occur on the endpoint.
- Authorization: Requires an authentication token for the request to be made.
- Invalid UserId: Occurs when the userId is invalid or does not belong to any user in the workspace.
- No Permission: Occurs when the authenticated user doesn't have the
view-moderation-console
permission.
{% tabs %} {% tab title="Authorization" %}
{
"status": "error",
"message": "You must be logged in to do this."
}
{% endtab %}
{% tab title="No Permission" %}
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
{% endtab %} {% endtabs %}
Version | Description |
---|---|
6.2.0 | Added |