Skip to content
This repository was archived by the owner on Jun 13, 2022. It is now read-only.

mpoust/WhereToDoAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

WhereToDoAPI

API for CIT368 Group Project 1 - WhereToDo

Application Information

The API can be accessed at: https://wheretodoapi.azurewebsites.net/

The structure of this project was created with guidance provided by a Lynda.com class "Building and Securing RESTful APIs in ASP.NET Core" by Nate Barbettini.

Classes derived from this course are marked, along with unique classes specific to this project within a header comment for each file.

The primary locations of interest for this project are probably:

  1. Controllers (Folder)
    • UsersController.cs
    • ListController.cs
  2. Services (Folder)
    • DefaultUserService.cs
    • DefaultListService.cs

Primary API Actions

User Actions

  1. Create a User Account:
    POST to /users route with JSON body:

    {
       "username": "testUsername",
       "password": "Password123!"
    }
  2. Authenticate User for Login:
    POST to /token route with 'x-www-form-urlencoded' KEY/VALUE pairs:

    KEY VALUE
    grant_type password
    username testUsername
    password Password123!

    This will return something similar to:

    {
       "scope": "roles",
       "token_type": "Bearer",
       "access_token": "token_value_string"
    }

    The token_value_string should be included within an Authorization header for all subsequent requests to the API. The header should follow the KEY/VALUE pair format of:

    KEY VALUE
    Authorization Bearer token_value_string
  3. Modify User Account (Change Password):
    PATCH to /users route with JSON body:

    {
       "currentpassword": "Password123!",
       "newpassword": "Password456!"
    }

Task (List) Actions

  1. Add a Task (List):
    POST to /list route with JSON body:

    {
       "title": "Sample List POST",
       "location": "GitHub README",
       "lat": "10.000",
       "long": "10.000"
    }
  2. Modify a Task (List):
    PATCH to /list/{listID} route with JSON body:

    [
       { "op": "replace", "path": "/title", "value": "Modified Task/List Title" }
    ]

    This PATCH supports all PATCH operations. The example above modifies the title of the List. The same concept can be applied to /status to update the status of a particular List.

  3. DELETE to /list{listID} route.
    There is no body to this request. All that is needed is the Authorization header, the same as all other actions.

About

Spring 2019 API for CIT368 Group Project 1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages