-
Notifications
You must be signed in to change notification settings - Fork 189
Open
Labels
questionQuestion about how to use the SDKQuestion about how to use the SDKstaleThere has been no activity on this issueThere has been no activity on this issue
Description
How do I
cancel and start a new verify2 request on SMS channel with same number
API/Product
Verify V2
Code Sample
async restartVerification(
params: Pick<
PendingAccount,
'phoneNumber'
> & { previousVerificationRequestId: string },
) {
try {
const e164FormatPhoneNumber = formatPhoneNumberToE164(params.phoneNumber);
await this.vonage.verify2.cancel(params.previousVerificationRequestId);
const { requestId: newVerificationRequestId } =
await this.vonage.verify2.newRequest({
brand: SMS_BRAND,
workflow: [{ channel: Channels.SMS, to: e164FormatPhoneNumber }],
channelTimeout: VERIFICATION_TIMEOUT,
});
} catch (error) {...}
}This code was working fine a few hours ago. Now, it seems some time (a dozen seconds) has to pass between verify2.cancel and verify2.newRequest or Vonage will return a 409 Conflict error, even though request is canceled. We already make sure to only call cancel 30s after request was created
Any idea how to manage that? Is there a limitation on calling new request after calling cancel?
Thank you
Metadata
Metadata
Assignees
Labels
questionQuestion about how to use the SDKQuestion about how to use the SDKstaleThere has been no activity on this issueThere has been no activity on this issue