everydayhero: Developer

Teams

List all Teams

Authentication types: Registered Application Token or OAuth User Token

List all teams in the authenticated application’s campaign if using Registered Application authentication, or all the user’s teams if using OAuth User authentication.

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

Params

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

Example

https://everydayhero.com/api/v2/teams

Response

{
  "teams": [
    {
      "id": 1,
      "uid": 1,
      "name": "Team Example",
      "leader_id": 42,
      "page_ids": [
        42,
        53,
        123
      ]
    }
  ]
}

View a single team

Authentication types: Registered Application Token or OAuth User Token

Get a specific team in the authenticated application’s campaign if using a Registered Application authentication, or in the user’s teams if using OAuth User authentication.

Example

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

Response

{
  "team": {
    "id": 1,
    "uid": 1,
    "name": "Team Example",
    "leader_id": 42,
    "page_ids": [
      42,
      53,
      123
    ]
  }
}

Create a Team

Authentication types: Registered Application Token or OAuth User Token

  • Must be created from an existing individual page

Creates a team with team page, and assigns the existing individual page (specified by the individual_page_id parameter) as the team leader.

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

Payload

individual_page_id : required integer
The id of the individual page which will become the team leader. This page must already exist.

If using Registered Application authentication, any team in the application's campaign can be used. If using OAuth User authentication the affiliated user must own the team.

name : optional string
The name of the team. This needs to be unique within the campaign.

Example

{
  "individual_page_id": 1,
  "name": "My New Team"
}

Response

{
  "page": [
    {
      "id": 2511,
      "slug": "my-new-team",
      "gift_aid_eligible": false,
      "charity_uid": "au-20",
      "campaign_uid": "au-305",
      "owner_uid": 273,
      "owner_type": "Team",
      "uid": 2511,
      "state": "active",
      "target_cents": 50050,
      "name": "My New Team",
      "team_uid": null,
      "team_member_uids": [
        2509
      ],
      "team_leader_page_uid": 2509,
      "expires_at": "2015-06-30T00:00:00.000Z",
      "amount": {
        "cents": 0,
        "currency": {
          "iso_code": "AUD",
          "name": "Australian Dollar",
          "symbol": "$"
        }
      },
      "cached_offline_amount_cents": 0,
      "campaign_date": null,
      "fitness_activity_overview": {

      },
      "story": "I've created this page because I want to make a difference. I'm inspired by the work of Test Charity for messaging and wanted to support them by raising money as part of my participation in Sandbox2. Please help me help them by giving whatever you can using the 'Give Now' button. The more people that know about Test Charity for messaging, the greater their impact, so please also spread the word by sharing my page with your friends and family. Thank you in advance for your generosity, it means a lot!\n",
      "image": {
        "original_image_url": "https://dqw0wvb05w98x.cloudfront.net/assets/pages/images/original/missing.gif",
        "tiny_image_url": "https://dqw0wvb05w98x.cloudfront.net/assets/pages/images/tiny/missing.gif",
        "small_image_url": "https://dqw0wvb05w98x.cloudfront.net/assets/pages/images/small/missing.gif",
        "medium_image_url": "https://dqw0wvb05w98x.cloudfront.net/assets/pages/images/medium/missing.gif",
        "large_image_url": "https://dqw0wvb05w98x.cloudfront.net/assets/pages/images/large/missing.gif"
      },
      "created_at": "2015-04-07T04:33:51.708Z",
      "updated_at": "2015-04-07T04:33:51.801Z",
      "url": "https://sandbox2.edheroz.com/au/my-new-team",
      "invitation_id": null,
      "coordinate": {
        "lat": -27.46,
        "lon": 153.03
      }
    }
  ]
}