-
Notifications
You must be signed in to change notification settings - Fork 1
API Documentation
BytexGrid edited this page Jan 16, 2025
·
1 revision
This document outlines the available API endpoints in SoftStacker.
All authenticated endpoints require a valid session cookie obtained through GitHub OAuth.
GET /api/templatesQuery Parameters:
-
os(string): Filter by operating system (windows, macos, linux) -
category(string): Filter by category -
search(string): Search templates by title or description
Response:
[
{
"id": "string",
"title": "string",
"description": "string",
"category": "string",
"target_os": "string",
"apps": Array,
"votes": number,
"author_name": "string",
"author_avatar": "string"
}
]GET /api/templates/{id}Response: Single template object
POST /api/templatesRequest Body:
{
"title": "string",
"description": "string",
"category": "string",
"target_os": "string",
"apps": [
{
"name": "string",
"description": "string",
"website": "string",
"category": "string",
"isRequired": boolean,
"packageName": "string"
}
]
}POST /api/templates/draftRequest Body: Same as Create Template
GET /api/templates/draftGET /api/templates/{id}/vote/checkResponse:
{
"voteType": "up" | "down" | null,
"votes": number
}POST /api/templates/{id}/voteRequest Body:
{
"voteType": "up" | "down"
}Response:
{
"message": "Vote added" | "Vote updated" | "Vote removed",
"votes": number
}GET /api/user/profileResponse:
{
"id": "string",
"name": "string",
"email": "string",
"avatar_url": "string"
}GET /api/user/analyticsResponse:
{
"total_templates": number,
"total_votes_received": number,
"most_popular_template": Template
}DELETE /api/user/dataResponse:
{
"message": "User data deleted successfully"
}All endpoints may return the following error responses:
- 400 Bad Request: Invalid input
- 401 Unauthorized: Authentication required
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Resource not found
- 500 Internal Server Error: Server error
Error Response Format:
{
"error": "Error message"
}