« Back to Documentation Overviewget_message_stats
Section: Messages
Version: 1.5.0
Get message statistics.
Conditions:
- message (mandatory) – MESSAGE_ID.
- grouping (optional) – Determines period of time by which stats are aggregated. Allowed values are: hourly (result keys in "YYYY-MM-DD HH" format), daily (result keys in "YYYY-MM-DD" format), monthly (result keys in "YYYY-MM" format) and yearly (result keys in "YYYY" format). Default is daily.
- created_on (optional) – Use time operators to narrow down search results to specific contact creation date. Multiple operators are allowed and logic AND is used so date range can also be expressed.
Hint: It is normal to have stats for given date with sent equals 0 and other values positive because opens, clicks, bounces and complaints take place also during a few days after message was sent.
Warning: Graduation may not be continuous. Given time period is present in result only if it has at least one positive value in it.
Warning: Unique action is always counted in period of time where action first occured. If contact opened message on day A and on day B then only day A will have positive unique_opened.
Parameters
|
---|
string | API_KEY |
object | string | message | MESSAGE_ID | string | grouping | daily | object | created_on | |
|
Return Value
|
---|
object | 2010-01-01 | integer | sent | 1024 | integer | opened | 512 | integer | unique_opened | 256 | integer | clicked | 128 | integer | unique_clicked | 64 | integer | goals | 8 | integer | unique_goals | 4 | integer | forwarded | 2 | integer | unsubscribes | 1 | integer | bounces_user_unknown | 8 | integer | bounces_user_recycled | 1 | integer | bounces_mailbox_full | 2 | integer | bounces_block_content | get_message_stats_bounces_block_content_0_integer | integer | bounces_block_timeout | get_message_stats_bounces_block_timeout_0_integer | integer | bounces_block_other | 1 | integer | bounces_other_soft | 16 | integer | bounces_other_hard | 2 | integer | complaints_handled | 1 | integer | complaints_unhandled | get_message_stats_complaints_unhandled_0_integer |
|
object | 2010-01-02 | integer | sent | get_message_stats_sent_0_integer | integer | opened | 64 | integer | unique_opened | 32 | integer | clicked | 16 | integer | unique_clicked | 8 | integer | goals | 2 | integer | unique_goals | get_message_stats_unique_goals_0_integer | integer | forwarded | get_message_stats_forwarded_0_integer | integer | unsubscribes | get_message_stats_unsubscribes_0_integer | integer | bounces_user_unknown | get_message_stats_bounces_user_unknown_0_integer | integer | bounces_user_recycled | get_message_stats_bounces_user_recycled_0_integer | integer | bounces_mailbox_full | 1 | integer | bounces_block_content | get_message_stats_bounces_block_content_0_integer | integer | bounces_block_timeout | get_message_stats_bounces_block_timeout_0_integer | integer | bounces_block_other | get_message_stats_bounces_block_other_0_integer | integer | bounces_other_soft | 2 | integer | bounces_other_hard | get_message_stats_bounces_other_hard_0_integer | integer | complaints_handled | 1 | integer | complaints_unhandled | get_message_stats_complaints_unhandled_0_integer |
|
Example Request JSON
[
"API_KEY",
{
"message": "MESSAGE_ID",
"grouping": "daily",
"created_on": {
"OPERATOR": "value"
}
}
]
Example Response JSON
{
"2010-01-01": {
"sent": 1024,
"opened": 512,
"unique_opened": 256,
"clicked": 128,
"unique_clicked": 64,
"goals": 8,
"unique_goals": 4,
"forwarded": 2,
"unsubscribes": 1,
"bounces_user_unknown": 8,
"bounces_user_recycled": 1,
"bounces_mailbox_full": 2,
"bounces_block_content": 0,
"bounces_block_timeout": 0,
"bounces_block_other": 1,
"bounces_other_soft": 16,
"bounces_other_hard": 2,
"complaints_handled": 1,
"complaints_unhandled": 0
},
"2010-01-02": {
"sent": 0,
"opened": 64,
"unique_opened": 32,
"clicked": 16,
"unique_clicked": 8,
"goals": 2,
"unique_goals": 0,
"forwarded": 0,
"unsubscribes": 0,
"bounces_user_unknown": 0,
"bounces_user_recycled": 0,
"bounces_mailbox_full": 1,
"bounces_block_content": 0,
"bounces_block_timeout": 0,
"bounces_block_other": 0,
"bounces_other_soft": 2,
"bounces_other_hard": 0,
"complaints_handled": 1,
"complaints_unhandled": 0
}
}
Example Error Response JSON
{
"code": -1,
"message": "Missing message"
}
Method-specific Errors
|
---|
Missing message |
API-wide Errors
|
---|
API key verification failed
| API key verification failed |
API client IP not allowed
| API client IP not allowed |
Invalid params
| Attribute params must be reference to hash |