everydayhero: Developer

Totals

Retrieve totals for Campaigns and Charities (public)

GET https://everydayhero.com/api/v2/search/totals

Parameters

charity_id : optional string
Charity ID, only totals for that the specified Charity will be retrieved.

campaign_id : optional string or Array
Campaign ID, only totals for that the specified Campaign will be retrieved. An Array of IDs can be provided, eg: campaign_id[]=au-1&campaign_id[]=au-2

page_id : optional string
Page ID, only totals for that the specified Page will be retrieved.

start_at : optional string/date-time
Start at date, ISO format: “2014-08-20 05:02:13”, filter totals by a range.

end_at : optional string/date-time
End at date, ISO format: “2014-08-20 05:02:13”, filter totals by a range.

kind : optional string
Filter by donation type: peer_to_peer, charity, appeal, recurring, offline_donation.

country_code : optional string
Filter by region, au, uk, us, nz.

group_value : optional String/Array
Return donations matching specific page group value, or any of the provided array values. An Array of values can be provided, eg: group_value[]=QLD&group_value[]=ABC

Response

Top level donation items include all totals. The “types” hash includes broken down donations by type. Each total hash includes a separate break down for gift aid totals and actual totals.

Totals are merged regardless of currency, so if multiple regions are being returned, it is assumed that currencies values are merged regardless of currency.

Nested hash details

doc_count / count: The number of items of this particular type of donation

avg : The average donation within this result set.

sum : The sum of donations within this result set.

max : The max donation within this result set.

min : The min donation within this result set.

{
  "total_amount_cents": {
    "count": 10,
    "min": 100,
    "max": 200,
    "avg": 150,
    "sum": 1230
  },
  "total_gift_aid_amount_cents": {
    "count": 10,
    "min": 100,
    "max": 200,
    "avg": 150,
    "sum": 1230
  },
  "types": {
    "peer_to_peer": {
      "total_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "total_gift_aid_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "doc_count": 124
    },
    "charity": {
      "total_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "total_gift_aid_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "doc_count": 124
    },
    "appeal": {
      "total_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "total_gift_aid_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "doc_count": 124
    },
    "recurring": {
      "total_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "total_gift_aid_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "doc_count": 124
    },
    "offline_donation": {
      "total_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "total_gift_aid_amount_cents": {
        "count": 10,
        "min": 100,
        "max": 200,
        "avg": 150,
        "sum": 1230
      },
      "doc_count": 124
    }
  }
}