Skip to content

Elizabeth-Warren/events-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f50ca46 Â· Jan 17, 2020
May 10, 2019
Jan 17, 2020
Oct 20, 2019
Feb 23, 2019
Apr 22, 2019
Feb 23, 2019
Feb 2, 2019
Jan 17, 2020
Nov 7, 2019
May 7, 2019
Aug 15, 2019
Jul 16, 2019
Jan 17, 2020

Repository files navigation

events-api

Lookup nearby campaign events.

Prod: https://api.elizabethwarren.codes/prod-events-v2

Staging: https://api.elizabethwarren.codes/staging-events-v2

Local Development

Requires Docker.

$ make tests

Deployment

Use the serverless toolbox,

# From the `serverless-toolbox` directory,
$ SRC=~/dev/events-api make toolbox # Replace ~/dev/events-api with the path
                                    # to the `events-api` on your host machine.

# Use `sls deploy --stage ...` if you make any changes beyond code.
$ sls deploy function -f api --stage staging
$ sls logs -f api --stage staging

Endpoints

Get Upcoming Events

Return a list of upcoming events ordered by priority then chronologically.

GET /events/upcoming

Response (200/json)
{
  events: [
    {
      title: String,
      date: String,
      startTime: String,
      endTime: String,
      timezone: String,
      publicAddress: String,
      city: String,
      state: String,
      zipcode: String,
      latitude: String,
      longitude: String,
      rsvpLink: String,
      highPriority: Bool,
      eventType: String,
    },
  ],
}

Get Nearby Events

Return a list of events near within 300 miles of given lat/lon coordinate ordered strictly by geographic proximity (not by priority and not by time).

GET /nearby?lat=${LATITUDE}&lon=${LONGITUDE}
GET /nearby?zip=${ZIP}

Response (200/json)
{
  events: [
    {
      title: String,
      date: String,
      startTime: String,
      endTime: String,
      timezone: String,
      publicAddress: String,
      city: String,
      state: String,
      zipcode: String,
      latitude: String,
      longitude: String,
      rsvpLink: String,
      highPriority: Bool,
      eventType: String,
    },
  ],
}

Get Upcoming High-Priority And Nearby Events

Return a list of upcoming events ordered by priority then by geographic proximity.

GET /upcoming-high-priority-and-nearby?lat=${LATITUDE}&lon=${LONGITUDE}
GET /upcoming-high-priority-and-nearby?zip=${ZIP}

Response (200/json)
{
  events: [
    {
      title: String,
      date: String,
      startTime: String,
      endTime: String,
      timezone: String,
      publicAddress: String,
      city: String,
      state: String,
      zipcode: String,
      latitude: String,
      longitude: String,
      rsvpLink: String,
      highPriority: Bool,
      eventType: String,
    },
  ],
}

Endpoint Errors

AWS API Gateway Errors

{
  "message": String,
}

Events API Errors

{
  error: {
    message: String,
  },
}