Services Report

This request is used to retrieve the preferred report on service activities based on a selected time period which can be a day, week, month or year.

Services report provides statistics for each of the following activities: URLs clicked, file downloads, redeemed vouchers and optout initiations.

HTTP Request

URLMethodDescription
https://app.tellody.com/CampaignCloud/Report/ServiceChart POST Get services report

POST Parameters

All involved parameters in the request are time related.

NameDescription
"from" This key should is 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 (e.g. week). For example, if a week period is selected, then "from" value should point 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 also 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 the string values: hour,day,week,month.
"window" This key is set to any of the following the 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

Based on the values used in the below request, a weekly report is requested and statistics are to be accumulated and presented per day. The exact week is specified using the appropriate values into "from"/"to" keys representing the start and end of the selected window (i.e. week) in milliseconds.

So, in the below example, the start of the week is on 19 July 2015 00h:00m:00s and corresponds to the integer value: 1437253200000. Similarly, the end of the week is on 25th July 2015 23h:59m:59s.999dec and corresponds to the value 1437857999999.

PythonOther

#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":1437253200000,"to":1437857999999,"unit":"day","window":"week","dow":0}
response = my_session.post("https://app.tellody.com/CampaignCloud/Report/ServiceChart", header, data).json()
print(json.dumps(response,ensure_ascii=False))

Sample Response

Each row represents the service activities per chosen unit (e.g. day). So since in the above request unit=day and window=week, its response below has 7 rows and values (1 per day of the week) per activity type. As a result, the first row for each type of activity corresponds to July 19, the second to July 20 and so on.

The below response indicates the following service related activities:

Activity TypeCountDay
File Downloads 4 Tuesday, July 21
Vouchers Redeemed 2 Tuesday, July 21
{
   "downloads":[
      0,
      0,
      4,
      0,
      0,
      0,
      0
   ],
   "optoutInit":[
      0,
      0,
      2,
      0,
      0,
      0,
      0
   ],
   "vouchers":[
      0,
      0,
      0,
      0,
      0,
      0,
      0
   ],
   "url":[
      0,
      0,
      0,
      0,
      0,
      0,
      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).

Back to Top