Envitera-api
Final Project Pengembangan Aplikasi Berbasis Web ITERAHTTP requests
All API requests are made by sending a secure HTTPS request using one of the following methods, depending on the action being taken:POSTCreate a resourcePUTUpdate a resourceGETGet a resource or list of resourcesDELETEDelete a resource
HTTP Response Codes
Each response will be returned with one of the following HTTP status codes:200 OKThe request was successful400 Bad RequestThere was a problem with the request (security, malformed, data validation, etc.)401 UnauthorizedThe supplied API credentials are invalid403 ForbiddenThe credentials provided do not have permission to access the requested resource404 Not foundAn attempt was made to access a resource that does not exist in the API405 Method not allowedThe resource being accessed doesn't support the method specified (GET, POST, etc.).500 Server ErrorAn error on the server An error on the server occurred.
Resources
each route which access is private required a token string in header.
Users
| Route | Description | Access |
|---|---|---|
POST api/users/register |
Register new user | Public |
POST api/users/login |
Login User and return a token | Public |
GET api/users/current |
Return user current payload | Private |
Profiles
| Route | Description | Access |
|---|---|---|
GET api/profile |
Get current user profile | Private |
GET api/profile/handle/:handle |
Get a profile by handle | Public |
GET api/profile/user/:user_id |
Get profile by user id | Public |
GET api/profile/all |
Get all profile | Public |
POST api/profile |
Create current user profile | Private |
GET api/profile/user/:user_id |
Get profile by user id | Public |