Calendar based Messaging and Codes Statistics
This request is used to retrieve the accumulated statistics report on messaging and code activity per type of activity based on a selected time period which can be a day, week, month or year.
The result provides the total statistics for each of the following activities: sent SMS & email, URLs clicked, downloads, vouchers viewed and optout initiations.
HTTP Request
URL | Method | Description |
---|---|---|
https://app.tellody.com/CampaignCloud/Report/UniqueCode | POST | Get messaging and codes report |
POST Parameters
All involved parameters in the request are time related.
Name | Description |
---|---|
"from" | This key should be set to a date in milliseconds to define the start of the reporting period. Both "from"/"to" keys should be carefully set to mark the correct start/end date of the selected type of window. For example, if a week period is selected, then "from" value points to the first day of the week that is also dictated by "dow" parameter which is also included in the request (e.g. Sunday). The user can select any given Sunday in the calendar but the "to" value should be set to the last day of the same week, (e.g. Saturday) since a week period is set for "window" key. |
"to" | This key is set to a date in milliseconds to define the end of the reporting period. See more details in the description of "from" key |
"unit" | This key is set to any of the following string values: hour,day,week,month. |
"window" | This key is set to any of the following string values: hour,day,week,month,year. |
"dow" | This key defines the start day of the calendar week to match the localization of the user For example, if the user is located in Europe, the "dow" should be set to zero indicating that the first day of the week is Sunday. For the US, "dow" should be set to 1 since the first day of the week is Monday. |
Sample Request
#Retrieving the XSRF Token needed for Session
pingResponse = my_session.get("https://app.tellody.com/CampaignCloud/RememberMeController/ping")
#Import the X-XSRF-Token returned from RememberMeController/ping into the request headers
xsrfToken = pingResponse.headers.get("X-XSRF-TOKEN")
#HTTP request header
header = {"Content-Type" : "application/json", "X-XSRF-TOKEN" : xsrfToken}
data = {"from":1436648400000,"to":1437253199999,"unit":"day","window":"week","dow":0}
response = my_session.post("https://app.tellody.com/CampaignCloud/Report/UniqueCode", header, data).json()
print(json.dumps(response,ensure_ascii=False))
Sample Response
Each value per row represents the total count per code activity type during the selected period.
Below is also a description of each key returned in the response.
JSON Key | Description |
---|---|
"SMS_SENT" | SMS attempts |
"DL" | File downloads |
"OPTOUT" | Optout initiations |
"URL" | Clicked URLs |
"VOUCHER" | Vouchers viewed |
"EMAIL_SENT" | Email attempts |
{
"SMS_SENT":79,
"DL":0,
"OPTOUT":0,
"URL":0,
"VOUCHER":0,
"EMAIL_SENT":0
}
Errors
In case of an error, information may be derived by the HTTP Status in the result of each request (e.g. HTTP 400 – Bad Request).