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ớiusername
,password
; tham số bổ sung:remember_me
(boolean:true
/false
). - Front:
POST api/front/login
vớiemail
,password
; 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ặpapiconnection | 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ởiapi/core/login
. - Đối với API front: dùng
access_token
tạo bởiapi/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.local
, your-bearer-token
, your-connection
, your-api-key
bằng giá trị thực tế của bạn.