MENUREADME | 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 / Registrationrequest. - or performing the below
User / Authenticationrequest. - or copying the
user tokenfromSign In >> Settings >> APIpage.
curl -X POST "$API_HOST/api/v1/user/registrations" \
-H "Content-Type: application/json" \
-d '{
"user": {
"email": "email@example.com",
"password": "123123123",
"password_confirmation": "123123123"
}
}'curl -X POST "$API_HOST/api/v1/user/sessions" \
-H "Content-Type: application/json" \
-d '{
"user": {
"email": "email@example.com",
"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@example.com"}}'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"