Message responses

Summary responses

Using the links provided in the message response, you can simply make a new API request to retrieve the summaryStatus URL.

The request for this information would look like this:

GET https://api.<region>.whispir.com/messages/069BF68E5E0FE99B/messagestatus?view=summary&apikey=498nadsasdff09fewdsafjaa90f

This request is asking for 3 things:

  • The URL is specifically asking for all of the messageresponses to the message with ID 069BF68E5E0FE99B.
  • The View parameter is specifying that the message responses should be shown in a summary view.
  • The Filter parameter is specifying that the filter should not use a response rule; it should show the default filter.

As this is a GET request you don’t have to provide any message body.

This response states that of the 2 people that were sent the message, both of them acknowledged it by sending a response.

Your application can use this information to easily determine the number of recipients in each state and show a small graph.

  • JSON
  • XML

Summary of responses

This snippet of code will allow users to retrieve the summary of responses to a message:

{{codeStart}}

{

"method": "GET",

"rel": "summaryResponses",

"uri": "https://api.<region>.whispir.com/messages/069BF68E5E0FE99B/messageresponses?view=summary&filter=default&apikey=498nadsasdff09fewdsafjaa90f"

}

{{codeEnd}}

Sample summary response

This response contains the summary of responses to the message:

{{codeStart}}

{

"messageresponses" : [ {

"percentageTotal" : "50%",

"responseCount" : "1",

"link" : [ ],

"type" : "noresponse"

},{

"percentageTotal" : "50%",

"responseCount" : "1",

"link" : [ ],

"type" : "notmatched"

} ],

"link" : [ {

"uri" : "https://api.<region>.whispir.com/messages/069BF68E5E0FE99B/messageresponses?view=summary&filter=default&apikey=498nadsasdff09fewdsafjaa90f",

"rel" : "self",

"method" : "GET"

} ]

}

{{codeEnd}}