@davidbolaji/termii-node
Version:
Node.js SDK for Termii API – send SMS, voice, OTP, and manage messaging with ease.
22 lines (21 loc) • 560 B
JavaScript
/**
* Service for verifying OTP tokens
*/
export class VerifyTokenService {
constructor(http) {
this.http = http;
}
/**
* Verify an OTP token by checking its pinId and PIN code
*
* @param payload - Request payload containing apiKey, pinId, and pin
* @returns Expanded `VerifyTokenResponse` with verification status
*/
async verifyToken(payload) {
return this.http.request("/sms/otp/verify", {
method: "POST",
data: payload,
authLocation: "body"
});
}
}