dummyapi
🔐

Auth

3 endpoints

Simulate login, token refresh, and authenticated user access using a Bearer token system.

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

Login with any username to get a fake JWT token. Password field is not verified (dummy API).

🔗

POST https://dummyapi.codesmash.in/api/auth/login

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

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

🔗

GET https://dummyapi.codesmash.in/api/auth/me

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

Refresh the access token.

🔗

POST https://dummyapi.codesmash.in/api/auth/refresh

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