API v1 Documentation

API v1 Documentation



Target release2017.1.0
Epic

GIFT-106 - Getting issue details... STATUS

Document status

ACTIVE

Document owner

Goals

  • Establish which API endpoints will need to be created

Questions

  • Should menu items be controlled by back end or front end?
  • How to handle email confirmation
  • How to handle nomination approval / rejection

Not Doing

Models

This table explains the structure of records to be returned by documented endpoints below

#TitleChildrenNotes
1User 



2Household
  • child
  • phone
  • attachment
  • address

API Documentation

Household

MethodURIDescriptionPermissionsQuery / ParamsReturn ValuesNotes
GET/households

GIFT-54 - Getting issue details... STATUS

admin - View all

nominator - View own

year

page (optional)

Array of households
GET/households/:id

admin - View all

nominator - View own


Household
POST/households

GIFT-107 - Getting issue details... STATUS

admin - No limit

nominator - Can only create as many households as their profile limit allows

Household object

PUT/households/:id

GIFT-108 - Getting issue details... STATUS

admin - Update any

nominator - Update own

Household object

PUT/households/:id/feedback

GIFT-57 - Getting issue details... STATUS

admin

approved - true / false

reason

message (optional)


Message is not stored; it's sent to the nominator if provided.
POST/households/:id/attachment

GIFT-109 - Getting issue details... STATUS

admin - Any household

nominator - Own household

file

file_path

attachment_id


Affiliation

MethodURIDescriptionPermissionsQuery / ParamsReturn Values
GET/affiliations

GIFT-52 - Getting issue details... STATUS

guest

type (optional) - cfc / cmpd / cms

Array of affiliations
GET/affiliations/:id

GIFT-139 - Getting issue details... STATUS

admin

Affiliation record with nested list of users that are part of the affiliation

User

MethodURIDescriptionPermissionsQuery / ParamsReturn Values
GET/users

GIFT-50 - Getting issue details... STATUS

admin

page (optional)

status (required) - active / pending / disabled

Array of users
PUT/users/pending/:id

GIFT-47 - Getting issue details... STATUS

adminapproved - true / false
GET/users/:id

GIFT-110 - Getting issue details... STATUS

admin - All

other - Self only


User
POST/users

GIFT-56 - Getting issue details... STATUS

admin

first_name

last_name

affiliation_id

rank

phone

password

nomination_limit


PUT/users/:id

GIFT-51 - Getting issue details... STATUS

admin - All

Other - Self only

first_name

last_name

affiliation_id

rank

phone

password

password_confirm

nomination_limit (Only admins can set this)


Auth

MethodURIDescriptionPermissionsQuery / ParamsReturn ValuesNotes
POST/auth/login

GIFT-45 - Getting issue details... STATUS

guest only

email

password

token

token_expiration


POST/auth/register

GIFT-46 - Getting issue details... STATUS

guest only

first_name

last_name

affiliation_id

rank (optional)

phone

password

password_confirm



POST/auth/verify_email

GIFT-111 - Getting issue details... STATUS

guest only

email

token



POST/auth/password_reset_token

GIFT-48 - Getting issue details... STATUS

guest onlyemail
Do not inform user if matching email was found.
POST/auth/password_reset

GIFT-114 - Getting issue details... STATUS

guest only

reset_token

password

password_confirm



Stats

MethodURIDescriptionPermissionsQuery / ParamsReturn Values
GET/stats/nominations

GIFT-120 - Getting issue details... STATUS

admin

year (required)

See JIRA ticket

Util

MethodURIDescriptionPermissionsQuery / ParamsReturn Values
GET/utils/household_address_info

GIFT-66 - Getting issue details... STATUS

registered

location (geopoint)

cmpd_division

cmpd_response_area