MENU
README | How to run locally | REST API doc | Web app screenshots
REST API documentation (cURL examples).
Set the following environment variables to use the examples below:
export API_HOST="http://localhost:3000"
export API_TOKEN="MY_USER_TOKEN"
You can get the API_TOKEN
by:
- Using the below
User / Registration
request. - or performing the below
User / Authentication
request. - or copying the
user token
fromSign In >> Settings >> API
page.
curl -X POST "$API_HOST/api/v1/user/registrations" \
-H "Content-Type: application/json" \
-d '{
"user": {
"email": "[email protected]",
"password": "123123123",
"password_confirmation": "123123123"
}
}'
curl -X POST "$API_HOST/api/v1/user/sessions" \
-H "Content-Type: application/json" \
-d '{
"user": {
"email": "[email protected]",
"password": "123123123"
}
}'
curl -X DELETE "$API_HOST/api/v1/user/registrations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN"
curl -X PUT "$API_HOST/api/v1/user/tokens" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN"
curl -X PUT "$API_HOST/api/v1/user/passwords" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-d '{
"user": {
"current_password": "123123123",
"password": "321321321",
"password_confirmation": "321321321"
}
}'
curl -X POST "$API_HOST/api/v1/user/passwords/reset" \
-H "Content-Type: application/json" \
-d '{"user": {"email": "[email protected]"}}'
curl -X PUT "$API_HOST/api/v1/user/passwords/reset" \
-H "Content-Type: application/json" \
-d '{
"user": {
"token": "TOKEN_RETRIEVED_BY_EMAIL",
"password": "123123123",
"password_confirmation": "123123123"
}
}'
curl -X GET "$API_HOST/api/v1/task/lists" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN"
curl -X POST "$API_HOST/api/v1/task/lists" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-d '{"task_list": {"name": "My Task List"}}'
curl -X PUT "$API_HOST/api/v1/task/lists/2" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-d '{"task_list": {"name": "My List"}}'
curl -X DELETE "$API_HOST/api/v1/task/lists/2" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN"
# ?filter=completed | incomplete
curl -X GET "$API_HOST/api/v1/task/lists/1/items" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN"
curl -X POST "$API_HOST/api/v1/task/lists/1/items" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-d '{"task": {"name": "My Task"}}'
# "completed": true | 1 | false | 0
curl -X PUT "$API_HOST/api/v1/task/lists/1/items/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-d '{"task": {"name": "My Task", "completed": true}}'
curl -X DELETE "$API_HOST/api/v1/task/lists/1/items/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN"