Giter VIP home page Giter VIP logo

build-sprint-guidr-reusable-be's Introduction

Guidr - Back-End


API Documentation

BASE URL https://guidr-project.herokuapp.com

  • Attach endpoints to the Base URL to hit them with HTTP Requests.

Table of Contents

NON-PROTECTED ENDPOINTS

Links Endpoints
POST Registration /users/signUp
POST Login /users/login

PROTECTED ENDPOINTS

All EndPoints listed below require a token! Send an authorizatoin header with the token provided upon login.

Links Endpoints
GET Trips by user ID /users/:id/trips
POST Add new trip /users/:id/trips
GET Get profile by user ID /users/:id/profile
PUT Update user profile info /users/:id/profile
GET Get all public trips /trips
PUT Update a trip by trip ID /trips/:id
DELETE Delete a trip by trip ID /trips/:id

[POST] Registration

Payload: an object with the following credentials:

Required: username, email, password, full_name

{
    "username": "newUsername",
    "password": "newPassword",
    "email": "[email protected]",
    "full_name": "John"
}

Return: Returns message that new user was create (may or may not be used by front end)


[POST] Login

Payload: an object with the following credentials:

Required: username, password

{
    "username": "newUsername",
    "password": "newPassword"
}

Return:

{
    "id": 5,
    "token": "9834yt834yg89024hy3t89347yt297wey78t643879fhuowe"
}

[GET] Get Trips by user ID

Return:

{
    "id": 8,
    "title": "Yosemite",
    "description": "When hiking through the park",
    "private": true,
    "type": "Hiking",
    "start_date": "2019-07-15",
    "end_date": "2019-07-17",
    "duration_hours": 5,
    "duration_days": 2
}

[POST] Add a new trip

Required: title, description, private, type, start_date, end_date, duration_hours, duration_days

{
    "title": "Yosemite",
    "description": "When hiking through the park",
    "private": true,
    "type": "Hiking",
    "start_date": "2019-07-15",
    "end_date": "2019-07-17",
    "duration_hours": 5,
    "duration_days": 2
}

Return:

{
    "id": 8,
    "title": "Yosemite",
    "description": "When hiking through the park",
    "private": true,
    "type": "Hiking",
    "start_date": "2019-07-15",
    "end_date": "2019-07-17",
    "duration_hours": 5,
    "duration_days": 2,
    "user_id": 4
}

[GET] Get profile by user ID

Return:

{
    "full_name": "Sean McDonnell",
    "email": "[email protected]",
    "username": "username",
    "title": "Outdoorsman",
    "description": "A person who does stuff outdoors",
    "age": 31,
    "experience_duration": "5 years"
}

[PUT] Update user profile info

Payload: an object with the following credentials:

Required: full_name, email, title, description, age, experience_duration

{
    "full_name": "Sean McDonnell",
    "email": "[email protected]",
    "title": "Outdoorsman",
    "description": "A person who does stuff outdoors",
    "age": 31,
    "experience_duration": "5 years"
}

Return:

{
    "full_name": "Sean McDonnell",
    "email": "[email protected]",
    "title": "Outdoorsman",
    "description": "A person who does stuff outdoors",
    "age": 31,
    "experience_duration": "5 years"
}

[GET] Get all public trips

Return:

{
    "id": 2,
    "title": "Lake Michigan",
    "description": "Kayaking at the lake",
    "private": false,
    "type": "Kayaking",
    "start_date": "2019-07-20",
    "end_date": "2019-07-20",
    "duration_hours": 12,
    "duration_days": 0,
    "user_id": 1
}

[PUT] Update a trip by trip ID

Payload: an object with the following credentials:

Required: title, description, private, type, start_date, end_date, duration_hours, duration_days

{
    "title": "Something",
    "description": "Kayaking at the lake",
    "private": false,
    "type": "Kayaking",
    "start_date": "2019-07-20",
    "end_date": "2019-07-20",
    "duration_hours": 12,
    "duration_days": 0
}

Return:

{
    "id": 2,
    "title": "Something",
    "description": "Kayaking at the lake",
    "private": false,
    "type": "Kayaking",
    "start_date": "2019-07-20",
    "end_date": "2019-07-20",
    "duration_hours": 12,
    "duration_days": 0,
    "user_id": 1
}

[DELETE] Delete a trip by trip ID

Return: Returns confirmation message that trip was deleted

Back to Top

build-sprint-guidr-reusable-be's People

Contributors

spmcdonnell avatar hannahtuttle avatar

Watchers

James Cloos avatar Austen Allred avatar B avatar Elissa Thomas avatar Brit Hemming avatar Soumya Ghosh avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.