The SMS verification function can be used for the user’s project registration, login, early warning and other scenarios. Nodejs realizes SMS verification through Axios, which is very simple. The following is a demonstration example of SMS interfaces of SMS suppliers in cloud markets. The code is as follows:
`var axios = require(‘axios’);
var qs = require(‘qs’);
var data = qs.stringify({
‘appId’: ’41KYR0EB**’,
‘appKey’: ‘IIWCKKSR7NOQ**’,
‘phone’: ‘1561894**’,
‘templateId’: ‘1043’,
‘variables’: ‘1234’
});
var config = {
method: ‘post’,
url: ‘https://vip.veesing.com/smsAp…‘,
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});`
Attention, the following is the key point:
1. SMS verification code must be used with graphic verification
2. The stability and cost of SMS interface are also important
3. Pay attention to limit the maximum number of captcha that can be obtained per day for a single number