🐱 PurrPal API Documentation

Base URL: http://localhost:8080

Note: Protected endpoints require Authorization header:
Authorization: Bearer your_jwt_token

🔐 Authentication

POST /api/auth/signup

Register new user

{
    "email": "user@example.com",
    "password": "password123",
    "username": "username123"
}
POST /api/auth/login

Login user

{
    "email": "user@example.com",
    "password": "password123"
}

👤 User Management

GET /api/users/profile

Get user profile (Protected)

PUT /api/users/profile

Update user profile (Protected)

{
    "full_name": "Full Name",
    "role": "Pet Owner",
    "location": "City",
    "bio": "About me"
}

📝 Stories

GET /api/stories

Get all stories

POST /api/stories

Create new story (Protected)

📚 Education Modules

GET /api/modules

Get all modules

GET /api/modules/:id

Get module details

🤖 Chatbot

POST /api/chatbot/message

Send message to PurrPal AI (Protected)

{
    "message": "Kucing saya tidak mau makan, apa yang harus saya lakukan?"
}
GET /api/chatbot/history

Get conversation history (Protected)

DELETE /api/chatbot/history

Clear conversation history (Protected)

GET /api/chatbot/health

Check chatbot health status

🧠 AI Detection NEW

POST /api/ai/predict-symptoms NEW

Predict cat disease based on symptoms questionnaire (Protected)

{
    "cat_info": {
        "name": "Fluffy",
        "age": "2 tahun",
        "gender": "female",
        "weight": 4.5,
        "body_temperature": 39.0,
        "duration_days": 5,
        "heart_rate": 130
    },
    "questionnaire": {
        "cough": true,
        "breathingDifficulty": false,
        "fever": true,
        "discomfort": true,
        "appetiteLoss": true,
        "weightLoss": false,
        "vomiting": false,
        "diarrhea": false
    }
}
GET /api/ai/health NEW

Check AI services health status

GET /api/ai/info NEW

Get information about available AI services

POST /api/ai/detect-image

AI image detection (Coming Soon)

{
    "image_url": "url_to_image"
}