everydayhero: Developer

Static Leaderboards

Static leaderboards are leaderboards that have been manually built within the supporter application.

If you are looking for dynamically generated & filterable leaderboards, see Dynamic leaderboards

The Leaderboards API allows you to retrieve leaderboards and their assocated pages.

List all Leaderboards (public)

GET https://everydayhero.com/api/v2/leaderboards

Parameters

ids : optional string
1,5,20 to only retrieve leaderboards with the ids 1, 5 and 20

Pagination

For more information about pagination, please see the pagination overview.

limit : optional integer
The number of items per page.

page : optional integer
The page number to return.

Example

https://everydayhero.com/api/v2/leaderboards.json?ids=1,5,20

Response

{
  "leaderboards": [
    {
      "id": 1,
      "amount": {
        "cents": "1000",
        "currency": {
          "iso_code": "AUD",
          "symbol": "$",
          "name": "Australian Dollar"
        }
      },
      "name": "My Leaderboard",
      "pages_ids": [
        1,
        2
      ]
    }
  ]
}

View a single Leaderboard (public)

GET https://everydayhero.com/api/v2/leaderboards/:id

Example

https://everydayhero.com/api/v2/leaderboards/1.json

Response

{
  "leaderboard": {
    "id": 1,
    "amount": {
      "cents": "1000",
      "currency": {
        "iso_code": "AUD",
        "symbol": "$",
        "name": "Australian Dollar"
      }
    },
    "name": "My Leaderboard",
    "pages_ids": [
      1,
      2
    ]
  }
}

View a Campaign Leaderboard (public)

Campaign Leaderboards are a way of showing the top supporter pages for a particular campaign.

GET https://everydayhero.com/api/v2/campaigns/:id/leaderboard

Parameters

type : optional string
The types of pages that are required. Supported values include all, individual and team. Defaults to all.

limit : optional integer
The number of records retrieved. This is useful for showing a “top 10 supporters leaderboard”. Defaults to 10.

charity_ids : optional string
Only retrieve pages associated to the charity(ies) specified. Multiple charities can be passed through as comma separated values, i.e. ‘au-1,au-5’.

all_pages : optional boolean
Retrieve all pages including pages that are not active. It is false by default, and therefore only active pages will be included in the results.

Example

https://everydayhero.com/api/v2/campaigns/au-1/leaderboard.json?type=individual&charity_ids=au-1,au-5&limit=5

Response

{
  "leaderboard": {
    "campaign_id": "au-1",
    "page_ids": [
      1,
      2
    ]
  }
}