It is so simple to use nodejs – Axios to realize SMS verification function


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: ‘…‘,
headers: {

'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'

data : data

.then(function (response) {
.catch(function (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

NodeJs – Axios.js And document description download

Recommended Today

Method of hiding version number and web page cache time in nginx

Nginx Optimization — Hide version number and page cache time Configure nginx to hide version number In the production environment, we need to hide the version number of nginx to avoid security Leakage of loopholes View method Use Fiddler I to check the nginx version number on the Windows client Using “curl – I URL” […]