Srapsware
🔌 API Reference

API Documentation

Complete REST API reference with authentication, endpoints, and code examples in multiple languages

50+
Endpoints
99.9%
Uptime
<100ms
Response

Quick Start

1. Get Your API Key

Sign up for a free account to get your API key. You can find it in your dashboard under Settings → API Keys.

Get API Key

2. Authentication

All API requests require authentication using Bearer tokens. Include your API key in the Authorization header:

// Authentication using JWT Token
const response = await fetch('https://api.srapsware.com/api/users', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);

3. Make Your First Request

Try fetching the list of users with the example below:

// JavaScript/Node.js Example
const fetch = require('node-fetch');

async function getUsers() {
  const response = await fetch('https://api.srapsware.com/api/users', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    }
  });
  
  const data = await response.json();
  console.log(data);
}

getUsers();

API Endpoints

GET/api/users

Retrieve a list of all users

Auth: Required

Parameters

pageinteger

Page number (default: 1)

limitinteger

Items per page (default: 20)

searchstring

Search query

Response

{
  "users": [
    {
      "id": 1,
      "name": "John Doe",
      "email": "john@example.com",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 100
  }
}
POST/api/users

Create a new user

Auth: Required

Request Body

namestringRequired

User's full name

emailstringRequired

User's email address

passwordstringRequired

User's password (min 8 characters)

Response

{
  "id": 101,
  "name": "John Doe",
  "email": "john@example.com",
  "createdAt": "2024-01-15T10:30:00Z",
  "message": "User created successfully"
}
GET/api/users/:id

Get a specific user by ID

Auth: Required

Parameters

idintegerRequired

User ID

Response

{
  "id": 1,
  "name": "John Doe",
  "email": "john@example.com",
  "role": "admin",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-20T14:20:00Z"
}
PUT/api/users/:id

Update an existing user

Auth: Required

Request Body

namestring

User's full name

emailstring

User's email address

Response

{
  "id": 1,
  "name": "John Smith",
  "email": "johnsmith@example.com",
  "updatedAt": "2024-01-22T16:45:00Z",
  "message": "User updated successfully"
}
DELETE/api/users/:id

Delete a user

Auth: Required (Admin only)

Parameters

idintegerRequired

User ID

Response

{
  "message": "User deleted successfully",
  "deletedAt": "2024-01-22T17:00:00Z"
}

Error Codes

CodeDescription
200OK - Request successful
201Created - Resource created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource does not exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong

Ready to Get Started?

Get your API key and start building amazing applications today

Get API Key