Skip to main content

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 :#

{
"staffId" : "45186",
"startDate" : 1733011200000,
"endDate" : 1733184000000
}

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 :#

[
{
"id": "b3f0b6c2-6f0e-4a57-9d55-1c7a8e2b9f41",
"senderUserId": 1452871,
"senderDomainId": "45186",
"senderApp": "DevelopmentPostman",
"customerIds": ["70021", "70022", "70024"],
"message": [10, 7, 77, 101, 114, 104, 97, 98, 97],
"createdAt": 1733130000000
}
]
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 statusMessageDescription
400Required headers not foundOne or more of the x-dlg-date, x-dlg-requester-userid or x-dlg-authorization headers are missing.
400Authorization failed due to data format not validThe x-dlg-authorization value after DLGA is not in the AccessKeyId:Signature form.
400Date format is invalid. EEE, dd MMM yyyy HH:mm:ss Z is requiedThe x-dlg-date value cannot be parsed in this format. The message text is returned as shown, including its spelling.
401Authorization failedThe x-dlg-authorization header does not contain DLGA , the AccessKeyId is unknown, or the signature is not correct.
401You have no permission on this operation. Contact your admin.The signature is correct, but your access key has no application permission.
403Request time may not be correct.The x-dlg-date value differs from the server time by more than 15 minutes.