Danh sách API hệ thống hỗ trợ

  • Xem danh sách API: https://[domain]/gp247_admin/api_connection.

Lấy access_token

  • Core: POST api/core/login với usernamepassword; tham số bổ sung: remember_me (boolean: true/false).
  • Front: POST api/front/login với emailpassword; tham số bổ sung: remember_me (boolean: true/false).

Tăng bảo mật với API Connection

  • Truy cập https://[domain]/gp247_admin/api_connection để kích hoạt tính năng và tạo cặp apiconnection | apikey.
  • Khi bật, API Connection sẽ áp dụng cho tất cả endpoint API (core và front).

Lưu ý

  • Đối với API core: dùng access_token tạo bởi api/core/login.
  • Đối với API front: dùng access_token tạo bởi api/front/login cho các endpoint bảo mật.
  • Nếu sử dụng API Connection, header này áp dụng cho mọi endpoint (core và front).

Ví dụ gọi API

curl -X GET "https://your-domain.local/api/your_resource" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-bearer-token" \
  -H "apiconnection: your-connection" \
  -H "apikey: your-api-key"

Ghi chú: thay your-domain.localyour-bearer-tokenyour-connectionyour-api-key bằng giá trị thực tế của bạn.