Base URL: https://www.scriptinphp.com/samples/api/ · 3 registered users · All endpoints return JSON
Returns system status, PHP version, database connectivity, and user count. No authentication required.
Authenticate with email and password. Returns a 24-hour bearer token. Include in subsequent requests via the X-Token header.
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | ● Yes | User email address |
password | string | ● Yes | Account password |
Create a new user account. Validates email format, checks for duplicates, hashes password with bcrypt.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ● Yes | Full name |
email | string | ● Yes | Email address (must be unique) |
password | string | ● Yes | Minimum 6 characters |
Validate an existing token. Returns user info if valid, 401 if expired or invalid. Log in first to get a token.
Returns full profile of the authenticated user. Send token via X-Token header.
Returns paginated list of registered sample users (max 20). Requires valid authentication token.
Invalidates the current session token. Token is immediately revoked server-side.