getstaffmessaginglist
POST v1/reporting/getstaffmessaginglist#
With this API, you can access the list of an employee's messaging through Diyalog between two dates. A customer number can also be added as a parameter; if it is, only the employee's messaging with that customer is listed.
An employee's messaging with another person is listed on a daily basis. The list returned by the API can be very long, so the service responds with pagination. For this, the API takes the page number and the expected number of items per page as parameters. The number of items per page should not be greater than 20. Otherwise, the service returns at most 20 items.
API requests
- Must be authenticated with HMAC Authentication. For HMAC Authentication, see the Authentication document.
- API URI : https://DIYALOG-SERVER-API-ENDPOINT/v1/reporting/getstaffmessaginglist
- HTTP Request Type POST
- HTTP Content-Type application/json
Request Body#
| Schema |
|---|
| json object |
| startDate (long) Unix epoch timestamps (miliseconds). The start date of the messaging query. |
| endDate (long) Unix epoch timestamps (miliseconds). The end date of the messaging query. |
| staffId (string) Employee ID. The employee ID of the employee whose messaging list is requested. |
| customerId (string) Optional. Customer number. If given, the API returns the employee's messaging with this customer. |
| isGroupMessaging (boolean) Optional. If this parameter is not sent, the API returns both group and private conversations. If it is added to the request with the value true, only group messaging is returned. Similarly, if its value is false, the API returns only private messaging. |
| pageNumber (int) The page number index for pagination. To get the next data, make the request again with the same query parameters and an incremented index. |
| pageSize (int) The maximum number of items per page for pagination. It should not exceed 20. If it is more than 20, the API returns a maximum of 20 items. |
Example Json Request Body :#
Responses#
| HTTP 200 Response |
|---|
| json object array The API returns a json array as a response. The array contains json objects with the following fields. Each object contains the details of a messaging. Using pagination, the API returns up to pageSize items (json objects) as given in the request, sorted by date from newest to oldest. If no call is found, an empty array is returned. |
| json object |
| senderId (string) The employee ID of the sender. |
| nameOfSender (string) The first and last name of the sender. |
| receiverId (string) The employee ID or customer number of the receiver. |
| nameOfReceiver (string) The first and last name of the receiver. |
| messagingDate (long) Unix epoch timestamps (miliseconds). The day on which the messaging took place. Since data is kept on a daily basis, use only the date part of this value. The time is always 00:00. |
| sendMessageCount (int) The number of messages the sending employee sent to the person on that day. The count has a margin of error of up to 10 messages. |
| isGroupMessaging (boolean) The messaging may be a group messaging. If it is a group messaging, this field returns "true"; otherwise "false". |
| groupId (int) If the messaging is a group messaging, this field returns the unique group id created by the Diyalog platform. |
| conversationDetailLink (string) A dynamic link for viewing the messaging by connecting to the Diyalog platform. When this link is opened in a browser, it connects to the Diyalog application and the message contents can be viewed in the Diyalog application. |
Example Response Body :#
| HTTP 500 Response |
|---|
| string When the API encounters an error, it returns a response with the HTTP 500 status code. The API's error message is returned as text. |
If the request fails HMAC validation, the following errors are returned as plain text. See Authentication.
| HTTP status | Message | Description |
|---|---|---|
| 400 | Required headers not found | One or more of the x-dlg-date, x-dlg-requester-userid or x-dlg-authorization headers are missing. |
| 400 | Authorization failed due to data format not valid | The x-dlg-authorization value after DLGA is not in the AccessKeyId:Signature form. |
| 400 | Date format is invalid. EEE, dd MMM yyyy HH:mm:ss Z is requied | The x-dlg-date value cannot be parsed in this format. The message text is returned as shown, including its spelling. |
| 401 | Authorization failed | The x-dlg-authorization header does not contain DLGA , the AccessKeyId is unknown, or the signature is not correct. |
| 401 | You have no permission on this operation. Contact your admin. | The signature is correct, but your access key has no reporting permission. |
| 403 | Request time may not be correct. | The x-dlg-date value differs from the server time by more than 15 minutes. |