everydayhero: Developer

Users

Get current user

Authentication types: OAuth User Token

GET https://passport.everydayhero.com/api/v1/me

Parameters

access_token : required string
User access_token provided by passport auth hash.

Example

https://passport.everydayhero.com/api/v1/me.json?access_token=xxxxx

Response

{
  "user": [
    {
      "uid": 1,
      "name": "John O'Donnell",
      "email": "john@example.com",
      "nickname": "John",
      "birthday": "1980-01-13",
      "street_address": "87 Wickham Terrace",
      "locality": "Spring Hill",
      "region": "QLD",
      "postal_code": "4006",
      "country_name": "Australia",
      "phone": "1300798768",
      "internal_id": "213",
      "id": "1",
      "page_ids": [
        1,
        2
      ]
    }
  ]
}

Update a new user with attributes

Authentication types: OAuth User Token

PUT https://passport.everydayhero.com/api/v1/me

Parameters

access_token : required string
User access_token provided by passport auth hash.

User address

The user address should be sent as a hash of attributes, although a single string is also supported.

user[address][street_address] : optional string
user[address][extended_address] : optional string
user[address][locality] : optional string
user[address][region] : optional string
user[address][postal_code] : optional string
user[address][country_name] : optional string
user[address][latitude] : optional string
user[address][longitude] : optional string

or

user[address] : optional string
The address passed through must be locatable through the Google Maps API. Example: “87 Wickham Terrace, Spring Hill, 4000, QLD”

user[birthday] : optional string
User birthday, format “YYYY-MM-DD”.

user[phone] : optional string
User phone number

Example

PUT https://passport.everydayhero.com/api/v1/me?access_token=xxxx&user%5Baddress%5D=87+Wickham+Terrace,Spring+Hill,4000,QLD&user%5Bbirthday%5D=1970-01-01

Repsonse

204 or 40X

List all Users for Registered Application’s Campaign

Authentication types: Registered Application Token

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

Response

{
  "users": [
    {
      "uid": 1,
      "name": "John O'Donnell",
      "email": "john@example.com",
      "nickname": "John",
      "birthday": "1980-01-13",
      "street_address": "87 Wickham Terrace",
      "locality": "Spring Hill",
      "region": "QLD",
      "postal_code": "4006",
      "country_name": "Australia",
      "phone": "1300798768",
      "internal_id": "213",
      "id": "1",
      "page_ids": [
        1,
        2
      ]
    },
    {
      "uid": 1,
      "name": "John O'Donnell",
      "email": "john@example.com",
      "nickname": "John",
      "birthday": "1980-01-13",
      "street_address": "87 Wickham Terrace",
      "locality": "Spring Hill",
      "region": "QLD",
      "postal_code": "4006",
      "country_name": "Australia",
      "phone": "1300798768",
      "internal_id": "213",
      "id": "1",
      "page_ids": [
        1,
        2
      ]
    }
  ]
}