API Specs

  • POST Log-in

  • Will return bearer token to store in session data

  • /token

  • x-www-form-urlencoded

  • ?grant_type=password&username={UserEmail}&password={UserPassword}

UserController

  • POST Create User

  • Specific User by User Details (see mockup and features)

  • Only Admins can create Organizations

  • api/users

  • Include User JSON Parameters Object

  • PUT Update User

  • User can update own user only. Admin can update any user.

  • To change password, include "OldPassword" and "NewPassword" in JSON object. These fields are optional. Leave off "Password" when updating the user.

  • api/users/{UserEmail}/

  • Include User JSON Parameters Object

  • DELETE Delete User

  • User can delete own user only. Admin can delete any user.

  • api/users/{UserEmail}/

  • GET User (by Email)

  • Anyone logged in can pull up user profile

  • Specific user can pull up sensitive user information

  • api/users/{UserEmail}/

User JSON Parameters Object (Data)

  • Email*, Password*, FirstName*, LastName*, DisplayName, Category**, ProfileDescription, StreetAddressOne, StreetAddressTwo, City, State, ZipCode

  • Tags: [{Name: "Tag Name"}, {Name: "Tag Name"} ...]

  • * = Required

ActivityActionController

  • POST RSVP Activity by ID

  • Any user can RSVP for an activity

  • api/activities/{ActivityId}/rsvps/{UserName}/


  • POST Check In Activity by ID

  • api/activities/{ActivityId}/checkins/{UserName}/


  • POST Create Activity

  • Only Organization can create activity, linked to their own organization

  • Admin can create activity linked to any organization

  • api/activities

  • Include Activity JSON Parameters Object


  • PUT Update Activity

  • Organizations can update their own activity

  • Admin can update any activity

  • api/activities/{ActivityId}

  • Include Activity JSON Parameters Object


  • DELETE Delete Activity

  • Organizations can delete their own activity

  • Admin can delete any activity

  • api/activities/{ActivityId}

Activity JSON Parameters Object (Data)

  • OrganizationUserName*, DisplayTitle*, Description, Category**, StartTime*, EndTime, AddressDisplayName, StreetAddressOne, StreetAddressTwo, City, State, ZipCode

  • Tags: [{Name: "Tag Name"}, {Name: "Tag Name"} ...]

  • * = Required

  • Any logged in user
  • GET Activity (by ID)

  • api/activities/{ActivityId}

  • GET Activities

  • api/activities

  • GET Activities by Tag

  • api/activities/tags/{TagName}

  • GET Activities by Start Date and End Date

  • api/activities/startdate={StartDate}&enddate={EndDate}

  • GET Activities by Category

  • api/activities/categories/{CategoryName}

  • GET Activities by Organization

  • api/activities/organizations/{OrganizationUserName}/

  • GET Activities by User and Tags

  • Specific user can access this

  • api/activities/users/{UserName}/

TagsController

  • POST Create Tag

  • Admin only

  • api/activities/tags/{TagName}


  • DELETE Delete Tag

  • Admin only

  • api/activities/tags/{TagName}


  • GET Tags

  • Any logged in user

  • api/activities/tags

Enums

**Pass in the number corresponding to the correct category.

ActivityCategory

[Display(Name = "Rally/Protest")]
Protest = 0,
[Display(Name = "School Meeting")]
School = 1,
[Display(Name = "Government Meeting")]
Government = 2,
[Display(Name = "Internal Organization Meeting")]
Internal = 3,
[Display(Name = "Informational Meeting")]
Informational = 4,
[Display(Name = "Community Meeting")]
Community = 5,
[Display(Name = "Independent Activity")]
IndependentActivity = 6

OrganizationCategory

[Display(Name = "Regular User")]
NA = 0,
[Display(Name = "Government")]
Government = 1,
[Display(Name = "Educational")]
Educational = 2,
[Display(Name = "Volunteer")]
Volunteer = 3,
[Display(Name = "Neighborhood Association")]
Neighborhood = 4,
[Display(Name = "Partisan Political")]
Political = 5,
[Display(Name = "Non-partisan Political")]
Cause = 6


google api

https://developers.google.com/civic-information/