Questions? Feedback? powered by Olark live chat software

Newsman API Page

Newsman API » Newsman API 1.0 » Account » account.counters

Newsman Api Method: account.counters

Prototype: account.counters($key, $account_id, $start_date, $stop_date, $unit)

Description: Returns the counters for this account between “start_date” and “stop_date” grouped by “unit”.

“start_date” and “stop_date” are the dates in your local timezone (format: YYYY-mm-dd or YYYY-mm-dd HH:MM:SS).
There must be max 180 days (~6 months) between “start_date” and “stop_date”

Returns a dictionary for each of the following actions: send, view, click, unsub, bounce, hardbounce, reject, spam.

For each action there is a dictionary returned with format:
   total: < int >
   utotal: < int >

“total” means the total number of “actions”
“utotal” means the unique number of “actions” (for example unique views)

If “unit” is “hours” for each day, details are added for each hour (unique and total):
   total: < int >
   utotal: < int >
      u: < int >
      t: < int >
      u: < int >
      t: < int >

If no information are found for a day or hour, the entry is listed with 0 for the totals.

The counters are calculated based on send_date. So if a view of a message sent yesterday is made today, the view counter incremented is for yesterday (send date).

Return: struct

Variable Type Description
$key string API key
$account_id string
$start_date date or datetime
$stop_date date or datetime
$unit string must be ‘days’ or ‘hours’

Curl Code Example

curl -G \
	-d key=928sk8sd489rmf9smkaaha99 \
	-d account_id=test90210 \
	-d start_date=2013-10-07 \
	-d stop_date=2013-10-12 \
	-d unit=days