getbroadcastmesssageofuserbydomainid
POST v1/application/getbroadcastmesssageofuserbydomainid#
With this API, you can query the broadcast messages a staff member sent within a given date range, using the staff member's user number in your system.
Messages created within the given date range are returned sorted from newest to oldest. At most 20 records are returned per request; to retrieve more records, narrow the date range and query again.
API requests
- Must be authenticated with HMAC Authentication. For HMAC Authentication, see the Authentication document.
- API URI : https://DIYALOG-SERVER-API-ENDPOINT/v1/application/getbroadcastmesssageofuserbydomainid
- HTTP Request Type POST
- HTTP Content-Type application/json
Request Body#
| Schema |
|---|
| json object |
| staffId (String) User number of the staff member in your system. This is the staffId value you sent in the broadcastmesssage request. |
| startDate (Unix epoch timestamps (miliseconds)) Query start time. Messages created at or after this time are returned. |
| endDate (Unix epoch timestamps (miliseconds)) Query end time. Messages created at or before this time are returned. |
Example Json Request Body :#
Responses#
| HTTP 200 Response |
|---|
| json object array The API returns a json array containing broadcast message details. If no records are found, an empty array is returned. |
| id (String) Unique id of the broadcast message in the Diyalog system (broadcastId). |
| senderUserId (integer) Diyalog user id of the staff member who sent the message. |
| senderDomainId (String) User number of the staff member who sent the message in your system (staffId). |
| senderApp (String) Name of the application that made the broadcast request. For requests made via the API, this is the application name used in HMAC authentication. |
| customerIds (String array) Customer numbers the message was intended to be sent to. |
| message (byte array) Content of the sent message. The message is returned as a byte array serialized in Diyalog's internal message format (protobuf). Since the values are signed bytes, non-ASCII characters are represented as negative numbers. |
| createdAt (Unix epoch timestamps (miliseconds)) Creation time of the broadcast request. |
Example Response Body :#
| HTTP 400 Response |
|---|
| string If the request body is not valid JSON, a required field is missing, or a field has the wrong type, the API returns a response with the HTTP 400 status code. The error message is returned as text. |
| HTTP 500 Response |
|---|
| string When the API encounters a general error, it will return 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 application permission. |
| 403 | Request time may not be correct. | The x-dlg-date value differs from the server time by more than 15 minutes. |