Skip to main content
Version: v1.5.0

ตั้งค่ารหัสผ่าน

การจัดการเกี่ยวกับรหัสผ่านของผู้ใช้งาน ซึ่งมีการเปลี่ยนรหัสผ่านที่หน้าโปรไฟล์ของผู้ใช้งาน และการรีเซ็ตรหัสผ่านกรณีผู้ใช้งานลืมรหัสผ่าน สามารถดำเนินการได้โดยใช้ประโยชน์จาก API Services จำนวน 2 เส้นทาง (Endpoint) ดังต่อไปนี้

  1. Change password : สำหรับเปลี่ยนรหัสผ่านผู้ใช้งาน โดยการตั้งค่าที่หน้าโปรไฟล์
  2. Forgot Password : สำหรับรีเซ็ตรหัสใหม่ กรณีผู้ใช้งานลืมรหัสผ่าน
OrderNameMethodPath
1 POST/managements/1.0/account/change-password
2 POST/managements/1.0/email/reset-password

ตัวอย่างเรียกใช้ Change Password API​

const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <access_token>");
const raw = JSON.stringify({
oldPassword: "123456",
newPassword: "67890",
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow",
};
fetch(
"https://va-cdn-02.vallarismaps.com/core/api/managements/1.0/account/change-password",
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));

ตัวอย่างเรียกใช้ Forgot Password API​

const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"redirect": "custom",
"email": "[email protected]",
"url": "management/setting-password"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://va-cdn-02.vallarismaps.com/core/api/managements/1.0/email/reset-password", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));