2025-12-01 02:22:35 -03:00
|
|
|
# Chapter 10: REST API Reference
|
2025-11-24 13:02:30 -03:00
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
HTTP API endpoints for integrating with BotServer.
|
2025-11-24 13:02:30 -03:00
|
|
|
|
|
|
|
|
## Base URL
|
|
|
|
|
|
|
|
|
|
```
|
2025-12-01 02:22:35 -03:00
|
|
|
http://localhost:8000/api/v1
|
2025-11-24 13:02:30 -03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Authentication
|
|
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
```bash
|
|
|
|
|
Authorization: Bearer <token>
|
2025-11-24 13:02:30 -03:00
|
|
|
```
|
|
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
## Core Endpoints
|
2025-11-24 13:02:30 -03:00
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
| Endpoint | Method | Description |
|
|
|
|
|
|----------|--------|-------------|
|
|
|
|
|
| `/chat` | POST | Send message, get response |
|
|
|
|
|
| `/sessions` | GET | List active sessions |
|
|
|
|
|
| `/sessions/:id` | GET | Get session details |
|
|
|
|
|
| `/files` | POST | Upload file |
|
|
|
|
|
| `/files/:id` | GET | Download file |
|
2025-11-24 13:02:30 -03:00
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
## Quick Example
|
2025-11-24 13:02:30 -03:00
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
```bash
|
|
|
|
|
curl -X POST http://localhost:8000/api/v1/chat \
|
|
|
|
|
-H "Authorization: Bearer $TOKEN" \
|
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
|
-d '{"message": "Hello", "session_id": "abc123"}'
|
2025-11-24 13:02:30 -03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Response Format
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"success": true,
|
2025-12-01 02:22:35 -03:00
|
|
|
"data": { ... },
|
|
|
|
|
"error": null
|
2025-11-24 13:02:30 -03:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
## Chapter Contents
|
2025-11-24 13:02:30 -03:00
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
- [Files API](./files-api.md) - Upload/download
|
|
|
|
|
- [Document Processing](./document-processing.md) - Text extraction
|
|
|
|
|
- [Users API](./users-api.md) - User management
|
|
|
|
|
- [Groups API](./groups-api.md) - Group management
|
|
|
|
|
- [Conversations API](./conversations-api.md) - Chat sessions
|
|
|
|
|
- [Calendar API](./calendar-api.md) - Scheduling
|
|
|
|
|
- [Tasks API](./tasks-api.md) - Task management
|
|
|
|
|
- [Storage API](./storage-api.md) - Object storage
|
|
|
|
|
- [Analytics API](./analytics-api.md) - Metrics
|
|
|
|
|
- [Admin API](./admin-api.md) - Administration
|
|
|
|
|
- [AI API](./ai-api.md) - LLM endpoints
|
|
|
|
|
- [Example Integrations](./examples.md) - Code samples
|
2025-11-24 13:02:30 -03:00
|
|
|
|
|
|
|
|
## See Also
|
|
|
|
|
|
2025-12-01 02:22:35 -03:00
|
|
|
- [API and Tooling](../chapter-09-api/README.md) - Tool definitions
|
|
|
|
|
- [Authentication](../chapter-12-auth/README.md) - Security
|