Skip to content

JoseyKinnaman/animal_shelter_api

Repository files navigation

Animal Shelter API

By Jozy Kinnaman

June, 2020

Description

A Ruby on Rails Friday Project excercise for building an API. Epicodus, 2020.

Setup//Install

Endpoints

GET

  • /pets returns all pets and their parameters (id, breed, age, desc, gender, adoptable, species)
  • /pets/:id returns an pet and its parameters matching the id
  • /pets/random will return a random pet and its parameters
  • /pets?name= will return a search result for a pet by a specific name
  • /pets?page=2 will return a list of 10 pets per page

DELETE

  • /pets/:id will delete an pet and its parameters matching the id

POST

  • /pets will create an pet and add it to the database

PUT

  • /pets/:id will update a parameter or parameters of an pet

Known Bugs

  • no known bugs

Contact and Support

[email protected]

Technologies Used

  • Ruby
  • Rails
  • Active record
  • Postgres

License

Jozy Kinnaman (c) 2020 MIC

Animal Shelter API Documentation

This API uses POST request to communicate and HTTP response codes to indenticate status and errors. All responses come in standard JSON. All requests must include a content-type of application/json and the body must be valid JSON.

Response Codes

Response Codes

200: Success
400: Bad request
401: Unauthorized
404: Cannot be found
405: Method not allowed
422: Unprocessable Entity 
50X: Server Error

Error Codes Details

100: Bad Request
110: Unauthorized
120: User Authenticaion Invalid
130: Parameter Error
140: Item Missing
150: Conflict
160: Server Error

Example Error Message

http code 402
{
    "code": 404,
    "message": "Cannot be found
    ",
    "resolve": "Couldn't find Pet with 'id'=101"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published