Skip to content

Message Count

To retrieve the message count for a channel in a QIE instance, call the URI http(s)://<qie_server>:<management_api_port>/engine/messageCount with the following payload:

{
   "zoneName": "<desired zone>",
   "channelName": "<desired channel>",
   "startDate": "<start date>",
   "endDate": "<end date>"
}

Base JSON Payload Definition

Node Description
zoneName REQUIRED: The name of the zone containing the channel.
channelName REQUIRED: The name of the channel.
startDate REQUIRED: The start of the date range to be summed
endDate REQUIRED: The end of the date range to be summed.

The following response is received when the export was successful:

HTTP Status: 200

{
   "zoneName": "<zone_name>",
   "channelName": "<channel_name>",
   "channelId": "<channel_id>",
   "startDate": "<start date>",
   "endDate": "<end date>",
   "receivedCount": "<received_count>",
   "destinationNodes": [
      {
         "destinationNodeId": "<destination_node_id>",
         "index": "<index>",
         "title": "<title>",
         "completedCount": "<completed_count>",
         "description": "<description>",
         "endpointId": "<endpoint_id>"
      },
      ….
   ]
}
Node Description
zoneName The name of the zone as shown when logged into the QIE service.
channelName The name of the channel as shown when logged into the QIE service.
channelId The unique ID of the channel found on the channel properties dialog.
startDate The start of the date range passed in the request.
endDate The end of the date range passed in the request.
receivedCount The number of messages received for the date range specified using startDate and endDate. This is a count of all messages received.
destinationNodes Array of one or more destination nodes. Definition in next table. Destination nodes without any completed messages during the date range are not included in this array. This array may be empty if there were no completed messages during the date range.

Destination JSON Object Definition

Node Description
destinationNodeId The unique destination node id.
title Title of the destination node.
index Index of the destination node.
completedCount The completed count for the destination node.
description Description of the destination node.
endpointId The endpointId of the destination node.

If there is an error getting the message counts, then the following response is received:

HTTP Status: 400

{
   "error": "<error message>"
}

Example curl command:

curl -H "apiToken:abc123" --request POST http://qieserver:9999/engine/messageCount -d '{"zoneName":"myZoneName","channelName":"myChannelName","startDate":"2022-03-23","endDate":"2022-03-25"}'
curl -H "apiToken:abc123" --request POST http://qieserver:9999/engine/messageCount -d "{\"zoneName\":\"myZoneName\",\"channelName\":\"myChannelName\",\"startDate\":\"2022-03-23\",\"endDate\":\"2022-03-25\"}"
curl -H @{"apiToken"="abc123"} -Method POST http://qieserver:9999/engine/messageCount -Body '{"zoneName":"myZoneName","channelName":"myChannelName","startDate":"2022-03-23","endDate":"2022-03-25"}' | Select-Object -Expand RawContent