Get the origin of messages sent during a specific period. It highlights the number of messages sent in private channels, private chats, and public channels.
{% hint style="info" %}
It requires view-engagement-dashboard
permission.
{% endhint %}
URL | Requires Auth | HTTP Method |
---|---|---|
/api/v1/engagement-dashboard/messages/origin |
yes |
GET |
Argument | Example | Required | Description |
---|---|---|---|
start |
2023-05-20T00:00:00.000Z |
Required | The start date. |
end |
2023-10-05T14:48:00.000Z |
Required | The end date. |
curl --location 'http://localhost:3000/api/v1/engagement-dashboard/messages/origin?start=2023-02-20T00%3A00%3A00.000Z&end=2023-05-30T00%3A00%3A00.000Z' \
--header 'x-auth-token: HF0U3GBQHzC0pL_f_XXFHEfgXR8041XGldg2m_z8JQ0' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ'
{
"origins": [
{
"messages": 7302,
"t": "c"
},
{
"messages": 1147,
"t": "d"
},
{
"messages": 122,
"t": "p"
}
],
"success": true
}
{% hint style="info" %}
t
denotes the type of room where the messages are sent.
d
representsPrivate Chats
c
representsPublic Channels
p
representsPrivate Channels
{% endhint %}
Any of the following errors can occur on the endpoint.
- Authorization: Requires an authentication token for the request to be made.
- No Permission: Occurs when the authenticated user doesn't have the
view-engagement-dashboard
permission. - Invalid Date: This occurs when the
start
orend
date does not follow the accepted format (2023-10-05T14:48:00.000Z
).
{% 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 %}
{% tab title="Invalid Date" %}
{
"success": false,
"error": "Match error: Failed Match.Where validation in field start"
}
{% endtab %} {% endtabs %}
Version | Description |
---|---|
3.1.0 | Added |