Đổi mật khẩu thài khoản API
Để đổi mật khẩu tài khoản qua API trên API.socdo.vn, bạn cần gửi email và password và otp kèm theo token xác thực (JWT) vào endpoint dưới đây.
Ví dụ minh họa: Đăng nhập tài khoản
Ví dụ minh họa: Đăng nhập tài khoản
POST https://api.socdo.vn/v1/change_password
các trường cần truyền lên:
- email: your_email
- password: your_password
- otp: your_otp
- re_password: your_password
Dữ liệu truyền lên (JSON):
{
"email": "your_email",
"password": "your_password
"re_password": "your_password",
"otp": "your_otp"
}
Ví dụ kết nối bằng cURL:
curl -X POST "https://api.socdo.vn/v1/change_password" -H "Content-Type: application/json" -H "Authorization: Bearer <token>" -d '{"email": "your_email", "passwork": "your_passwork", "re_passwork": "your_passwork", "otp": "your_otp"}'
Ví dụ kết nối bằng PHP:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.socdo.vn/v1/change_password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer <token>"
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"email" => "your_email",
"password" => "your_password",
"re_password" => "your_password",
"otp" => "your_otp"
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Dữ liệu trả về mẫu:
{
"success": true,
"message": "Đổi mật khẩu thành công"
}
Lưu ý: Bạn cần lấy token xác thực trước khi gọi API này (xem hướng dẫn lấy token ở mục Get token xác thực).
bạn cần lấy mã OTP qua API lấy mã OTP quên mật khẩu trước khi gọi API này.
Để xem hướng dẫn chi tiết từng API, vui lòng chọn chức năng ở menu bên trái.
bạn cần lấy mã OTP qua API lấy mã OTP quên mật khẩu trước khi gọi API này.
Để xem hướng dẫn chi tiết từng API, vui lòng chọn chức năng ở menu bên trái.