@@ -2,6 +2,7 @@ const rp = require('request-promise');
22
33/**
44 * send sms
5+ * @prarm {string} url - API url
56 * @param {string } uid - login account
67 * @param {string } password - login password
78 * @param {string } subject - message subject only for admin use
@@ -10,11 +11,10 @@ const rp = require('request-promise');
1011 * @param {string } time - time to send msg (leave blank for immediate delivery)
1112 * @returns {object } credit,sended numbers,cost,unsend numbers,batch id,error
1213 */
13- exports . send = async function ( uid , password , subject , msg , dest , time ) {
14- const url = 'https://api.e8d.tw/API21/HTTP/sendSMS.ashx' ;
14+ exports . send = async function ( url , uid , password , subject , msg , dest , time ) {
1515 try {
1616 const result = await rp ( {
17- uri : url ,
17+ uri : url || 'https://biz3.every8d.com.tw/prepaid/API21/HTTP/sendSMS.ashx' ,
1818 method : 'GET' ,
1919 qs : {
2020 UID : uid ,
@@ -48,15 +48,15 @@ exports.send = async function(uid, password, subject, msg, dest, time) {
4848
4949/**
5050 * get credit
51+ * @prarm {string} url - API url
5152 * @param {string } uid - login account
5253 * @param {string } password - login password
5354 * @returns {object } credit,error
5455 */
55- exports . getCredit = async function ( uid , password ) {
56- const url = 'https://api.e8d.tw/API21/HTTP/getCredit.ashx' ;
56+ exports . getCredit = async function ( url , uid , password ) {
5757 try {
5858 const result = await rp ( {
59- uri : url ,
59+ uri : url || 'https://biz3.every8d.com.tw/prepaid/API21/HTTP/getCredit.ashx' ,
6060 method : 'GET' ,
6161 qs : {
6262 UID : uid ,
0 commit comments