Skip to content

Urban-Jungle-Project/urban_jungle_app

Repository files navigation

Urban Jungle Application Overview

Urban Jungle application provides ability to care for your home plants.

API endpoints

Endpoint Details
/tokens Obtain bearer token [POST]:
curl -u "<username>:<password>" -X POST http://<host>:<port>/api/tokens

Revoke bearer token [DELETE]:
curl -X DELETE -H "Authorization: Bearer <token>" http://<host>:<port>/api/tokens

Not Allowed - OPTIONS, HEAD, GET, PUT, PATCH, TRACE
/users Get a collection of users [GET]:
curl -H "Authorization: Bearer <token>" http://<host>:<port>/api/users

Sign up new user [POST]:
curl -X POST -H "Content-Type: application/json" -d '{"email":"[email protected]","username":"example user","password":"12345678"}' http://<host>:<port>/api/users

Not Allowed - OPTIONS, HEAD, PUT, PATCH, DELETE, TRACE
/users/{id} Get user by id [GET]:
curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" http://<host>:<port>/api/users/1

Update user by id [PUT]:
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d '{"email":"[email protected]","username":"example user","password":"12345678"}' http://<host>:<port>/api/users/1

Not Allowed - OPTIONS, HEAD, POST, PATCH, DELETE, TRACE
/plants Get a collection of plants [GET]:
curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" http://<host>:<port>/api/plants

Create new plant [POST]:
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d '{"plant_name":"example name", "user_id": 1}' http://<host>:<port>/api/plants

Not Allowed - OPTIONS, HEAD, PUT, PATCH, DELETE, TRACE
/plants/{id} Get plant by id [GET]:
curl -H "Content-Type: application/json" -H "Authorization: Bearer <token>" http://<host>:<port>/api/plants/1

Update plant by id [PUT]:
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d '{"plant_name":"example name changed", "user_id": 1}' http://<host>:<port>/api/users/1

Delete plant by id [DELETE]:
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Bearer <token>" http://<host>:<port>/api/plants/1

Not Allowed - OPTIONS, HEAD, POST, PATCH, TRACE

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published