Welcome to Simple Ticket System API 🎫
A powerful RESTful API for managing support tickets with user and support roles. Built with Laravel 11 and Laravel Sanctum for secure authentication.
📋 Getting Started
All API requests should be made to the base URL: https://ticket.sozlerkosku.com/api
Authentication: Most endpoints require a Bearer token in the Authorization header. Get your token by registering or logging in.
🔐 Authentication
🎫 User Tickets
Note: This performs a soft delete. The ticket will be marked as deleted but not permanently removed from the database. Both ticket owners and support users can delete tickets.
👨💼 Support Endpoints
⚠️ Error Responses
Common HTTP Status Codes:
- 200 OK: Successful GET, PUT, PATCH requests
- 201 Created: Successful POST requests (resource created)
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (e.g., support-only endpoint)
- 422 Unprocessable Entity: Validation errors
- 404 Not Found: Resource doesn't exist
🚀 Quick Start Guide
Testing Workflow:
- Register a user: Use POST /register with role "user"
- Save the token: Copy the token from the response
- Create a ticket: Use POST /tickets with the user token
- Register support: Use POST /register with role "support"
- Answer ticket: Use POST /support/tickets/{id}/answer
💡 Tips:
- Replace
YOUR_TOKENwith your actual authentication token - All requests require
Accept: application/jsonheader - Support endpoints require a user with role "support"
- Use
-vflag with curl for verbose output - Copy curl commands using the "Copy" button for easy testing
📚 Example: Complete Workflow
1. Register a user:
2. Save the token from response, then create a ticket: