Working with message reports API

Working with message reports API

You can use this API to download a report of messages sent via CleverTap.

Endpoint

A request to get message reports is an HTTP URL of the following form:

POST https://api.clevertap.com/1/message/report.json

Authentication

All requests should include your CleverTap Account ID and CleverTap Account Passcode in the request headers keyed with X-CleverTap-Account-Id and X-CleverTap-Passcode , respectively.
Content-Type header must be specified as application/json.

Payload

JSON formatted payload with the following keys:

Required parameters

  • from – The date from which you want message details. Input values have to be formatted as integer YYYYMMDD
  • to – The date till which you want message details. Input values have to be formatted as integer YYYYMMDD

Optional parameters

  • channel – The channel of communication for which you want a report. Supported input values are : push (Mobile push messages), email, sms, browser (Browser push messages), audiences (Facebook messages), inapp (In-app messages), webhooks (Webhooks), web_pop_up (Web pop-ups), web_exit_intent (Web exit intent pop-ups).
  • delivery – Delivery type of communications for which you want a report. Supported input values are : one_time, inaction, action, recurring, property_time, api
  • daily – Determines if the report should be a day-wise split, or an aggregate report. Accepted values : true, false. Unless specified otherwise, the value of daily is set to false.
  • status – Determines the status of messages for which you want a report. Supported values are : scheduled, running, stopped, completed
  • message_type – Determines the type of messages for which you want a report. Supported values are : single, ab, message_on_user_property
  • label – Result will include a report only for messages that have the labels specified in your query.

All fields except daily support comma separated values

Sample Payload

{
   "from":"20171011",
   "to":"20171130",
   "daily":false,
   "channel":[
    "InApp"
   ],
   "delivery":[
    "inaction", "action"
   ],
   "status":[
    "completed"
   ],
   "message_type":[
    "single"
   ],
   "label":[

   ]
}

Sample Response

{
    "status": "success",
    "total_results": 1,
    "messages": [
        {
            "message id": 1508323121,
            "data": [
                [
                    {
                        "sent": 0,
                        "viewed": 0,
                        "clicked": 0
                    }
                ]
            ],
            "start_date": "Oct 18, 4:08 PM",
            "device": [
                "Android",
                "iOS",
                "WindowsMobile"
            ],
            "conversion_event": null,
            "labels": [],
            "channel": "InApp",
            "message_name": "in_app_outputs_test",
            "delivery": "Action"
        }
    ]
}

HTTP Response Codes

200 Successful request
400 Bad Request. Some mandatory parameter was missing