everydayhero: Developer

Pages

A page can belong to either a user or team (denoted by the ‘owner_type’ field). Pages belonging to a team have some special characteristics in that some of its fields represent an agregate of all its team members. Fields which have this characteristic include ‘amount’ and ‘custom_metric_total’.

List all Pages (public)

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

Parameters

ids : optional string
Only retrieve pages with the ids specified. 1,5,20 will retrieve pages with the ids 1, 5 and 20.

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

campaign_id : optional string
Only retrieve pages participating in the campaign specified.

charity_ids : optional string
Only retrieve pages supporting the specified charities. For example au-1,au-5 will retrieve pages which support charity ids au-1 and au-5.

start_updated_at : optional string
Only retrieve pages that have been updated after the supplied date/time. Format, ‘YYYY-MM-DDThh:mm:ssZ’

end_updated_at : optional string
Only retrieve pages that have been updated before the supplied datetime. Format, ‘YYYY-MM-DDThh:mm:ssZ’, timestamp optional

start_created_at : optional string
Only retrieve pages that have been created after the supplied date/time. Format, ‘YYYY-MM-DDThh:mm:ssZ’

end_created_at : optional string
Only retrieve pages that have been created before the supplied datetime. Format, ‘YYYY-MM-DDThh:mm:ssZ’, timestamp optional

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/pages.json?type=individual&campaign_id=au-1&charity_ids=au-1,au-5

Response

{
  "pages": [
    {
      "id": 1511,
      "slug": "tim",
      "gift_aid_eligible": false,
      "charity_uid": "au-6",
      "campaign_uid": "au-1419",
      "owner_uid": 7,
      "owner_type": "User",
      "uid": 1511,
      "state": "active",
      "target_cents": 70000,
      "name": "Tim",
      "team_uid": null,
      "team_member_uids": [

      ],
      "team_leader_page_uid": null,
      "expires_at": "2013-08-29T14:00:00Z",
      "created_at": "2013-08-29T14:00:00Z",
      "updated_at": "2013-08-29T14:00:00Z",
      "url": "https://give.everydayhero.com/au/sample",
      "amount": {
        "cents": 0,
        "currency": {
          "iso_code": "AUD",
          "name": "Australian Dollar",
          "symbol": "$"
        }
      },
      "cached_offline_amount_cents": 0,
      "fitness_activity_overview": {
        "run": {
          "duration_in_seconds": 20165,
          "calories": 6575,
          "distance_in_meters": 69141
        }
      },
      "invitation_id": null,
      "coordinate": {
        "lat": -32.88,
        "lon": 138.34
      },
      "story": "Hi Everyone, \r\nMy name is Budha and I am here to; raise awareness, a substantial amount of funds and to continuously remind you of the ongoing issues of youth homelessness, specifically a program known as 'Frontyard Youth Services' inside the Melbourne CBD. \r\n\r\n\"Frontyard seeks to provide young people with choices that contribute to their health and wellbeing, and where possible, return them to their community of origin.\"\r\n\r\nBeing in this age bracket as well as living in Melbourne, I feel as if i can make a difference and so can you!\r\n\r\nMy short-term goal is to raise at least $100,000 by this time next year! My long-term goal is to continue raising awareness and to support Melbourne based programs that affect our youth.\r\n\r\nWould appreciate as much love as I can get and stay tuned for the 2 major events that \"100% Entertainment\" will be hosting throughout the year!\r\n\r\nhttp://www.facebook.com/1Hundred.Percent.Entertainment\r\n\r\nThankyou",
      "image": {
        "original_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/original/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
        "tiny_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/tiny/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
        "small_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/small/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
        "medium_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/medium/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
        "large_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/large/image-3464747a20a5a8834f577c6ca2f66b5f.jpg"
      }
    }
  ]
}

View a single Page (public)

GET https://everydayhero.com/api/v2/pages/PAGE_ID_OR_UUID

The single page lookup includes expanded data including more granular total values.

You can also access a page API endpoint (via a redirect), by appending .json to the end of a URL

Example

https://givingtuesday2014.everydayhero.com/au/joel.json

redirects to

https://everydayhero.com/api/v2/pages/877323

Example

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

Response

{
  "id": 1511,
  "slug": "tim",
  "gift_aid_eligible": false,
  "charity_uid": "au-6",
  "campaign_uid": "au-1419",
  "owner_uid": 7,
  "owner_type": "User",
  "uid": 1511,
  "state": "active",
  "target_cents": 70000,
  "name": "Tim",
  "team_uid": null,
  "team_member_uids": [

  ],
  "team_leader_page_uid": null,
  "expires_at": "2013-08-29T14:00:00Z",
  "created_at": "2013-08-29T14:00:00Z",
  "updated_at": "2013-08-29T14:00:00Z",
  "url": "https://give.everydayhero.com/au/sample",
  "amount": {
    "cents": 0,
    "currency": {
      "iso_code": "AUD",
      "name": "Australian Dollar",
      "symbol": "$"
    }
  },
  "cached_offline_amount_cents": 0,
  "fitness_activity_overview": {
    "run": {
      "duration_in_seconds": 20165,
      "calories": 6575,
      "distance_in_meters": 69141
    }
  },
  "invitation_id": null,
  "coordinate": {
    "lat": -32.88,
    "lon": 138.34
  },
  "story": "Hi Everyone, \r\nMy name is Budha and I am here to; raise awareness, a substantial amount of funds and to continuously remind you of the ongoing issues of youth homelessness, specifically a program known as 'Frontyard Youth Services' inside the Melbourne CBD. \r\n\r\n\"Frontyard seeks to provide young people with choices that contribute to their health and wellbeing, and where possible, return them to their community of origin.\"\r\n\r\nBeing in this age bracket as well as living in Melbourne, I feel as if i can make a difference and so can you!\r\n\r\nMy short-term goal is to raise at least $100,000 by this time next year! My long-term goal is to continue raising awareness and to support Melbourne based programs that affect our youth.\r\n\r\nWould appreciate as much love as I can get and stay tuned for the 2 major events that \"100% Entertainment\" will be hosting throughout the year!\r\n\r\nhttp://www.facebook.com/1Hundred.Percent.Entertainment\r\n\r\nThankyou",
  "image": {
    "original_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/original/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
    "tiny_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/tiny/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
    "small_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/small/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
    "medium_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/medium/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
    "large_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/large/image-3464747a20a5a8834f577c6ca2f66b5f.jpg"
  },
  "meta": {
    "totals": {
      "total_amount_cents": 0,
      "online_amount_cents": 0,
      "offline_amount_cents": 0,
      "gift_aid_amount_cents": 0,
      "total_donations": 0,
      "total_donations_offline": 0,
      "currency": {
        "iso_code": "AUD",
        "name": "Australian Dollar",
        "symbol": "$"
      }
    },
    "has_set_image": true,
    "has_set_story": true,
    "self_donated": true
  }
}

Create an Individual Page

Authentication types: Registered Application Token or OAuth User Token

POST https://everydayhero.com/api/v2/pages

Payload

uid : required integer
The uid of the user that you want to create a page for.

uid is only required if Registered Application Token authentication is being used, otherwise the relevant user affiliated to the token will be used.

birthday : required string
Your birthday, format “YYYY-MM-DD”. In some countries there are age restrictions on fundraising and further action might need to be taken depending on the age provided.

charity_id : optional string
The id of the charity to create the page for. A charity will be system nominated if there is none specified.

campaign_id : required string
The id of the campaign to create the page for.

campaign_id is only required if OAuth User Token authentication is being used, otherwise the registered application's campaign will be used.

image : optional string
The URL of the image that will be uploaded as the page’s default image.

name : optional string
The desired name for your new supporter page. Defaults to the user’s preferred name.

slug : optional string
A URL-friendly version of the name parameter. Can only contain lower case characters, numbers, and hyphens. The slug will form part of the page URL and must be unique within the campaign. Maximum 60 characters.

expires_at : optional string
The date and time you want the page to expire. ISO8601 format. Defaults to 1 month after the campaign end date.

target : optional string
The dollar amount that you are aiming to raise (must be above 0).

token : optional string
An invitation token to join a team. This invitation was created by the team leader and sent to the user that you want to create a supporter page for.

gift_aid_eligible : optional boolean
UK specific fundraising criteria.

group_values : optional Hash/Array
If a campaign has group values available, these can be set, see the payload below for an example.

skip_notification: optional boolean
This skips sending the everydayhero page creation email if set as true, defaults to false.

Example

{
  "name": "Tim",
  "slug": "tim",
  "expires_at": "2013-10-21T17:15:08+10:00",
  "target": "500.50",
  "birthday": "1987-04-16T00:00:00+10:00",
  "gift_aid_eligible": null,
  "uid": 1,
  "charity_id": "au-1",
  "token": "1234567890",
  "group_values": {
    "school": "Abc",
    "state": "QLD"
  }
}

Response

{
  "page": {
    "id": 1511,
    "slug": "tim",
    "gift_aid_eligible": false,
    "charity_uid": "au-6",
    "campaign_uid": "au-1419",
    "owner_uid": 7,
    "owner_type": "User",
    "uid": 1511,
    "state": "active",
    "target_cents": 70000,
    "name": "Tim",
    "team_uid": null,
    "team_member_uids": [

    ],
    "team_leader_page_uid": null,
    "expires_at": "2013-08-29T14:00:00Z",
    "created_at": "2013-08-29T14:00:00Z",
    "updated_at": "2013-08-29T14:00:00Z",
    "url": "https://give.everydayhero.com/au/sample",
    "amount": {
      "cents": 0,
      "currency": {
        "iso_code": "AUD",
        "name": "Australian Dollar",
        "symbol": "$"
      }
    },
    "cached_offline_amount_cents": 0,
    "fitness_activity_overview": {
      "run": {
        "duration_in_seconds": 20165,
        "calories": 6575,
        "distance_in_meters": 69141
      }
    },
    "invitation_id": null,
    "coordinate": {
      "lat": -32.88,
      "lon": 138.34
    },
    "story": "Hi Everyone, \r\nMy name is Budha and I am here to; raise awareness, a substantial amount of funds and to continuously remind you of the ongoing issues of youth homelessness, specifically a program known as 'Frontyard Youth Services' inside the Melbourne CBD. \r\n\r\n\"Frontyard seeks to provide young people with choices that contribute to their health and wellbeing, and where possible, return them to their community of origin.\"\r\n\r\nBeing in this age bracket as well as living in Melbourne, I feel as if i can make a difference and so can you!\r\n\r\nMy short-term goal is to raise at least $100,000 by this time next year! My long-term goal is to continue raising awareness and to support Melbourne based programs that affect our youth.\r\n\r\nWould appreciate as much love as I can get and stay tuned for the 2 major events that \"100% Entertainment\" will be hosting throughout the year!\r\n\r\nhttp://www.facebook.com/1Hundred.Percent.Entertainment\r\n\r\nThankyou",
    "image": {
      "original_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/original/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
      "tiny_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/tiny/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
      "small_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/small/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
      "medium_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/medium/image-3464747a20a5a8834f577c6ca2f66b5f.jpg",
      "large_image_url": "https://deplyv9vomqtj.cloudfront.net/pages/images/26366/large/image-3464747a20a5a8834f577c6ca2f66b5f.jpg"
    },
    "campaign_date": null
  },
  "meta": {
    "url": "https://test-campaign-for-api.edheroz.com/au/tim"
  }
}