Categories
Categories API
GET GET list of categories
Get list of categories
GET categories
cURL
curl -X GET "http://localhost:8081/api/categories?" \ -H "Content-Type: application/json"
Response
[ { "_id": "58a446fcc26aaf13460533bd", "name": "Work" } ]
POST POST Add new category
Add new category to all users
POST categories
Optional parameters
Name /type | Description /example | Constraints |
---|---|---|
name |
|
cURL
curl -X POST "http://localhost:8081/api/categories" \ -H "Content-Type: application/json" \ --data '{}'
Response
{ "message": "Category created successful" }
DELETE DELETE category by id
Delete category for all users by id
DELETE categories/:identifier
cURL
curl -X DELETE "http://localhost:8081/api/categories/58a446fcc26aaf13460533bd" \ -H "Content-Type: application/json" \ --data '{}'
Response
{ "message": "Category removed successful" }