https://dummyapi-backend.onrender.com/api
CodeSmash โ†—

๐Ÿ”Auth โ€“ Docs

The auth endpoint lets you simulate login, token refresh, and authenticated user access using a Bearer token system.

Base URL: https://dummyapi-backend.onrender.com/api
POST

Login with username & password to get a fake JWT token.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/auth/login

fetch('https://dummyapi-backend.onrender.com/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"username": "emilys0password", "password": "emilys0password"})
})
.then(res => res.json())
.then(console.log);
GET

Get current authenticated user. Requires Authorization: Bearer <token>.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/auth/me

fetch('https://dummyapi-backend.onrender.com/api/auth/me')
.then(res => res.json())
.then(console.log);
POST

Refresh the access token.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/auth/refresh

fetch('https://dummyapi-backend.onrender.com/api/auth/refresh', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"refreshToken": "<your_refresh_token>"})
})
.then(res => res.json())
.then(console.log);