Upgrade guide
Upgrade from v1 to v2
Create code
Request
- The URL has changed from
https://api.cm.com/v1.0/otp/generatetohttps://api.cm.com/otp/v2/otp. recipienthas been renamed totoand now requires a phone number in E.164 format or a valid email address when channel is set toemail.senderhas been renamed tofromand now requires a phone number in E.164 format when channel is voice. For channelsmsandpushit also accepts an alphanumeric string between 3 and 11 characters.lengthhas been renamed todigits.allowPushis no longer used and is replaced by channelpushappKeyhas been renamed topushAppKeyand is only used and required when channel is set topush.allowVoiceis no longer used and is replaced by channelvoicevoiceLanguagehas been renamed tolocaleand now requires a locale code instead of a language code.
Response
expireAthas been renamed toexpiresAt
Verify code
Request
- The URL has changed from
https://api.cm.com/v1.0/otp/verifytohttps://api.cm.com/otp/v2/otp/{id}/verify, where {id} is the placeholder for the code identifier. - The OTP id is now provided in the URL instead of the request body.
- When the OTP cannot be found a 404 error is returned.
- When the OTP is expired, already verified or has too many verification attempts a 400 error is returned.
Response
validhas been renamed toverified.id,channel,createdAtandexiresAtare also returned
Updated 9 months ago