JavaScript / Node.js
Working examples using fetch. Install no additional dependencies for browser usage; for Node.js 18+, fetch is built in.
Get Locations
const response = await fetch("https://dewa.pulses.ai/Pulses/Gateway/Locations", {
headers: {
"ChannelKey": "YOUR_CHANNEL_KEY",
"TransactionId": crypto.randomUUID(),
},
});
const locations = await response.json();
console.log(locations);
Enroll a Face
const formData = new FormData();
formData.append("Image", fileInput.files[0]);
formData.append("AccountNumber", "ACC-001");
formData.append("ConsentFlag", "true");
formData.append("CustomerNameEnglish", "John Doe");
formData.append("IdentityDocId", "DOC-123");
formData.append("PassportNumber", "P1234567");
const response = await fetch(
"https://dewa-gwc.pulses.ai/Pulses/GatewayClient/ImageEnrollment",
{
method: "POST",
headers: {
"ChannelKey": "YOUR_CHANNEL_KEY",
"TransactionId": crypto.randomUUID(),
},
body: formData,
}
);
console.log("Result:", await response.text());
Lookup Customer by Face ID
const faceId = "YOUR_FACE_ID";
const response = await fetch(
`https://dewa-gwc.pulses.ai/Pulses/GatewayClient/GetCustomerDetails?FaceId=${faceId}`,
{
headers: {
"ChannelKey": "YOUR_CHANNEL_KEY",
"TransactionId": crypto.randomUUID(),
},
}
);
const customer = await response.json();
console.log(customer);