Lấy thông tin tài khoản
Dưới đây là hướng dẫn tích hợp API của API.socdo.vn vào hệ thống của bạn. Vui lòng sử dụng Token để xác thực.
Ví dụ minh họa: Lấy thông tin tài khoản
Ví dụ minh họa: Lấy thông tin tài khoản
POST https://api.socdo.vn/v1/user_info
Các trường cần truyền lên:
- user_id: ID tài khoản
- token: Token xác thực (JWT), truyền qua header
Authorization: Bearer <token>
Dữ liệu truyền lên (JSON):
{
"user_id": "your_user_id",
}
Ví dụ kết nối bằng cURL:
curl -X POST "https://api.socdo.vn/v1/user_info" -H "Authorization: Bearer <Token>" -H "Content-Type: application/json" -d '{"user_id": 2}'
Ví dụ kết nối bằng PHP:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.socdo.vn/v1/account/info");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <Token>",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['user_id' => 2]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Dữ liệu trả về mẫu:
{
"success": true,
"message": "Lấy thông tin thành công",
"data": {
"user_id": 2,
"shop": 0,
"username": "xahoigiaitri",
"email": "[email protected]",
"name": "Bùi Văn Lợi",
"avatar": "",
"user_money": 70100,
"user_money2": 1,
"mobile": "0979207011",
"domain": "xahoigiaitri.socdo.vn",
"ngaysinh": "",
"gioi_tinh": "",
"cmnd": "",
"ngaycap": "",
"noicap": "",
"tinh": 50,
"huyen": 550,
"xa": 8690,
"dia_chi": "24retryt",
"maso_thue": "1232434",
"maso_thue_cap": "",
"maso_thue_noicap": "",
"code_active": "",
"active": 1,
"nhan_vien": 0,
"chinh_thuc": 1,
"dropship": 1,
"ctv": 1,
"leader": 1,
"leader_start": "",
"gia_leader": 1,
"aff": "",
"doitac": "",
"about": "",
"nhom": "",
"status_cre": 1,
"created": "1634047649",
"date_update": "",
"ip_address": "127.0.0.1",
"logined": "",
"end_online": "",
"dk_aff": 0
}
}
Lưu ý: Để sử dụng các chức năng khác, vui lòng chọn chức năng ở menu bên trái để xem hướng dẫn chi tiết từng API.