everydayhero: Developer

Campaigns

List all Campaigns (public)

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

Parameters

charity_ids : optional string
A comma-separated list of Charity IDs, only Campaigns that the specified Charity is participating in will be retrieved.

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.

exclude_charities : optional boolean
Exclude embedding of charity IDs, to reduce payload size. Default: false.

exclude_pages : optional boolean
Exclude embedding of page IDs, to reduce payload size. Default: false.

Example

https://everydayhero.com/api/v2/campaigns.json?charity_ids=au-1,au-2,au-3

Response

{
  "campaigns": [
    {
      "id": "au-1",
      "name": "Run Melbourne",
      "status": "active",
      "slug": "run-melbourne",
      "start_at": "2013-04-01T00:00:00Z",
      "finish_at": "2013-04-01T00:00:00Z",
      "country_code": "au",
      "registration_url": "http://",
      "banner_url": "",
      "charity_ids": [
        123,
        456
      ],
      "charity_uids": [
        "au-654",
        "au-334"
      ],
      "funds_raised": {
        "cents": "1000",
        "currency": {
          "iso_code": "AUD",
          "symbol": "$",
          "name": "Australian Dollar"
        }
      },
      "fitness_activity_overview": {
        "run": {
          "duration_in_seconds": 20165,
          "calories": 6575,
          "distance_in_meters": 69141
        }
      },
      "custom_metric_total": {
        "custom_metric": {
          "amount": "100",
          "unit": "steps"
        }
      }
    }
  ]
}

Status will be: active, expired or disabled.

View a single Campaign (public)

GET https://everydayhero.com/api/v2/campaigns/CAMPAIGN_ID_OR_UUID

Example

https://everydayhero.com/api/v2/campaigns/au-1.json

Response

{
  "campaign": {
    "id": "au-1",
    "name": "Run Melbourne",
    "status": "active",
    "slug": "run-melbourne",
    "start_at": "2013-04-01T00:00:00Z",
    "finish_at": "2013-04-01T00:00:00Z",
    "country_code": "au",
    "registration_url": "http://",
    "banner_url": "",
    "charity_ids": [
      123,
      456
    ],
    "charity_uids": [
      "au-654",
      "au-334"
    ],
    "funds_raised": {
      "cents": "1000",
      "currency": {
        "iso_code": "AUD",
        "symbol": "$",
        "name": "Australian Dollar"
      }
    },
    "fitness_activity_overview": {
      "run": {
        "duration_in_seconds": 20165,
        "calories": 6575,
        "distance_in_meters": 69141
      }
    },
    "custom_metric_total": {
      "custom_metric": {
        "amount": "100",
        "unit": "steps"
      }
    }
  }
}