Skip to content

ali-sdk/ali-sms

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ali-sms

Build Status

Nodejs SDK for Aliyun SMS service

Install

npm install ali-sms --save

Usage

const sms = require("ali-sms");
const accessKeyID     = process.env.ALI_SMS_ACCESSKEYID;
const accessKeySecret = process.env.ALI_SMS_ACCESSKEYSECRET;

const config = {
  accessKeyID       : accessKeyID,
  accessKeySecret   : accessKeySecret,
  paramString       : {code: '123456'},
  recNum            : ['1891234567'],
  signName          : 'alibaba',
  templateCode      : 'SMS_28100008',
};
sms(config, (err, body) => {
  console.log(err, body);
});

Config

param type description
accessKeyID string access key id, get from aliyun
accessKeySecret string access key secret, get from aliyun
paramString object ali sms param which you have defined on aliyun sms dashboard
recNum array phone numbers of users
signName string ali sms param, get from aliyun sms dashboard
templateCode string ali sms param, get from aliyun sms dashboard

Note

It's often you'll get some errors if the params are not valid. So please double check accessKeyID, accessKeySecret, paramString, signName, templateCode on Aliyun dashboard.

Official document for error solution

https://help.aliyun.com/document_detail/52856.html

About

nodejs sdk for aliyun SMS service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%