dummyapi

Todos

6 endpoints

200 todo entries with completion status linked to specific users.

Base URLhttps://dummyapi.codesmash.in/api
GET

Get all todos.

🔗

GET https://dummyapi.codesmash.in/api/todos

?limit?skip
fetch('https://dummyapi.codesmash.in/api/todos')
.then(res => res.json())
.then(console.log);
ℹ️
Pagination — By default you will get 30 items. Use ?limit and ?skip to paginate through all items. Max limit is 200.
?limit=10Number of items to return (default: 30, max: 200)
?skip=10Number of items to skip (default: 0)
// By default you get 30 items
fetch('https://dummyapi.codesmash.in/api/todos?limit=10&skip=0')
.then(res => res.json())
.then(console.log);
// Get next page (items 11–20)
fetch('https://dummyapi.codesmash.in/api/todos?limit=10&skip=10')
.then(res => res.json())
.then(console.log);
// Get ALL 200 at once
fetch('https://dummyapi.codesmash.in/api/todos?limit=200')
.then(res => res.json())
.then(console.log);
GET

Get a single todo.

🔗

GET https://dummyapi.codesmash.in/api/todos/:id

fetch('https://dummyapi.codesmash.in/api/todos/:id')
.then(res => res.json())
.then(console.log);
GET

Get todos for a specific user.

🔗

GET https://dummyapi.codesmash.in/api/todos/user/:id

fetch('https://dummyapi.codesmash.in/api/todos/user/:id')
.then(res => res.json())
.then(console.log);
POST

Create a new todo (demo).

🔗

POST https://dummyapi.codesmash.in/api/todos

fetch('https://dummyapi.codesmash.in/api/todos', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
PUT

Update a todo.

🔗

PUT https://dummyapi.codesmash.in/api/todos/:id

fetch('https://dummyapi.codesmash.in/api/todos/:id', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
DELETE

Delete a todo.

🔗

DELETE https://dummyapi.codesmash.in/api/todos/:id

fetch('https://dummyapi.codesmash.in/api/todos/:id', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
Buy me a coffee