temp-api
← Back to Mock APIs

Mock Login & Auth API

Simulated login, tokens, and protected endpoints for login flows, permission checks, and 401 handling.

Data2 endpoints Base URLhttps://www.temp-api.com/en/mock Response{ code, message, data, meta }

Endpoints

POST/en/mock/login

Send email and password as JSON; returns a token and user.

GET/en/mock/profile

Send Authorization: Bearer mock-token-en to get the current user; returns 401 otherwise.

Open

Fields

FieldTypeDescription
emailstringLogin email (request)
passwordstringAny non-empty password (request)
tokenstringFixed mock token (response)
userobjectCurrent user (response)

Notes

  • The token is a fixed mock value, not a real credential. Do not use real passwords.

Example

curl -X POST "https://www.temp-api.com/en/mock/login" \
  -H "Content-Type: application/json" \
  -d '{"email":"emily.carter@example.com","password":"demo"}'
{
  "code": 200,
  "message": "ok",
  "data": {
    "token": "mock-token-en",
    "user": { "id": 1, "name": "Emily Carter", "role": "admin" }
  }
}

Related resources