Quick Start

Prerequisites

  • An active user account in the Kama system
  • API server address

Getting Started

Step 1: Login

First, obtain a token using the login endpoint:

curl -X POST "https://example.com/api/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"email": "admin@example.com", "password": "your-password"}'

Step 2: Get User Information

Use the obtained token to get your user information:

curl -X GET "https://example.com/api/auth/me" \
  -H "Authorization: Bearer {token}"

Step 3: List Clients

curl -X GET "https://example.com/api/clients" \
  -H "Authorization: Bearer {token}"

Step 4: Create a New Client

curl -X POST "https://example.com/api/clients" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Sample Company",
    "type": "organization",
    "phone": "021-12345678"
  }'

Common Errors

401 Unauthorized

Token is invalid or expired. Please login again.

403 Forbidden

You do not have the required access for this operation.

422 Validation Error

Submitted fields are invalid. Check the validation errors.

429 Too Many Requests

Respect the rate limit. Wait and try again.

Important Notes

  1. Store your token on the client side and send it with all requests.
  2. Token expiration time is 24 hours. You will need to login again after that.
  3. Use API Key for permanent access.
  4. All requests must have the Content-Type: application/json header (except in special cases).
  5. Send dates in YYYY-MM-DD format.
Type to search...