Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
melipayamak-api
Advanced tools
Readme
ملی پیامک یک وب سرویس کامل برای ارسال و دریافت پیامک و پیامک صوتی و مدیریت کامل خدمات دیگر است که براحتی میتوانید از آن استفاده کنید.
قبل از نصب نیاز به ثبت نام در سایت ملی پیامک دارید.
پس ازثبت نام برای نصب از راههای زیر میتوانید اقدام کنید.
npm install melipayamak-api
یا از طریق اضافه کردن خط زیر به فایل package.json
"melipayamak-api": "*"
و سپس اجرای دستور
npm update
نمونه کد برای ارسال پیامک
const MelipayamakApi = require('melipayamak-api')
const username = 'username';
const password = 'password';
const api = new MelipayamakApi(username,password);
const sms = api.sms();
const to = '09123456789';
const from = '5000...';
const text = 'تست وب سرویس ملی پیامک';
sms.send(to,from,text).then(res=>{
//RecId or Error Number
}).catch(err=>{
//
})
از آنجا که وب سرویس ملی پیامک تنها محدود به ارسال پیامک نیست شما از طریق زیر میتوانید به وب سرویس ها دسترسی کامل داشته باشید:
// وب سرویس پیامک
const smsRest = api.sms();
const smsSoap = api.sms('soap');
// وب سرویس تیکت پشتیبانی
const ticket = api.ticket();
// وب سرویس برای مدیریت کامل ارسال انبوه پیامک
const branch = api.branch();
//وب سرویس کاربران
const users = api.users();
//وب سرویس دفترچه تلفن
const contacts = api.contacts();
از آنجا که ملی پیامک وب سرویس کاملی رو در اختیار توسعه دهندگان میگزارد برای راحتی کار با وب سرویس پیامک علاوه بر وب سرویس اصلی soap وب سرویس rest رو هم در اختیار توسعه دهندگان گزاشته شده تا راحتتر بتوانند با وب سرویس کار کنند. تفاوت اصلی این دو در تعداد متد هاییست که میتوانید با آن کار کنید. برای کار های پایه میتوان از وب سرویس rest استفاده کرد برای دسترسی بیشتر و استفاده پیشرفته تر نیز باید از وب سرویس باید از وب سرویس soap استفاده کرد. جهت مطالعه بیشتر وب سرویس ها به قسمت وب سرویس پنل خود مراجعه کنید.
متد های وب سرویس:
smsRest.send(to,from,text,isFlash);
smsSoap.send(to,from,text,isFlash);
smsRest.isDelivered(recId);
smsSoap.isDelivered(recId);
smsRest.getMessages(location,index,count,from);
smsSoap.getMessages(location,index,count,from);
smsSoap.getMessagesStr(location,index,count,from);
// جهت دریافت به صورت رشته ای
smsSoap.getMessagesByDate(location,index,count,from,dateFrom,dateTo);
//جهت دریافت بر اساس تاریخ
smsSoap.getUsersMessagesByDate(location,index,count,from,dateFrom,dateTo);
// جهت دریافت پیام های کاربران بر اساس تاریخ
smsRest.getCredit();
smsSoap.getCredit();
smsRest.getBasePrice();
smsSoap.getPrice(irancellCount,mtnCount,from,text);
smsRest.getNumbers();
smsSoap.getInboxCount(isRead);
//پیش فرض خوانده نشده
smsSoap.send2(to,from,text,isflash,udh);
smsSoap.getMessagesReceptions(msgId,fromRows);
smsSoap.remove(msgIds);
smsSoap.sendSchedule(to,from,text,isflash,scheduleDateTime,period);
smsSoap.sendMultipleSchedule(to,from,text,isflash,scheduleDateTime,period);
smsSoap.addUsance(to,from,text,isflash,scheduleStartDateTime,repeatAfterDays,scheduleEndDateTime);
smsSoap.getScheduleStatus(schId);
smsSoap.removeSchedule(schId);
smsSoap.sendWithSpeech(to,from,text,speech);
smsSoap.sendWithSpeechSchduleDate(to,from,text,speech,scheduleDate);
smsSoap.getSendWithSpeech(recId);
branch.get(owner);
branch.add(branchName,owner);
branch.addNumber(mobileNumbers,branchId);
branch.remove(branchId);
branch.sendBulk(from,title,message,branch,DateToSend,requestCount,bulkType,rowFrom,rangeFrom,rangeTo);
branch.sendBulk2(from,title,message,branch,DateToSend,requestCount,bulkType,rowFrom,rangeFrom,rangeTo);
branch.getBulkCount(branch,rangeFrom,rangeTo);
branch.getBulkReceptions(bulkId,fromRows);
branch.getBulkStatus(bulkId);
branch.getTodaySent();
branch.getTotalSent();
branch.removeBulk(id);
branch.sendMultipleSms(to,from,text,isflash,udh);
branch.updateBulkDelivery(bulkId);
ticket.add(title,content,aletWithSms);
ticket.getReceived(ticketOwner,ticketType,keyword);
ticket.getReceivedCount(ticketType);
ticket.getSent(ticketOwner,ticketType,keyword);
ticket.getSentCount(ticketType);
ticket.response(ticketId,type,content,alertWithSms);
contacts.addGroup(groupName,Descriptions,showToChilds);
contacts.add(options);
contacts.checkMobileExist(mobileNumber);
contacts.get(groupId,keyword,from,count);
contacts.getGroups();
contacts.change(options);
contacts.remove(mobilenumber);
contacts.getEvents(contactId);
users.addPayment(options);
users.add(options);
users.addComplete(options);
users.addWithLocation(options);
users.authenticate();
users.changeCredit(amount,description,targetUsername,GetTax);
users.forgotPassword(mobileNumber,emailAddress,targetUsername);
users.getBasePrice(targetUsername);
users.getCredit(targetUsername);
users.getDetails(targetUsername);
users.getNumbers();
users.getTransactions(targetUsername,creditType,dateFrom,dateTo,keyword);
users.get();
users.hasFilter(text);
users.remove(targetUsername);
users.getProvinces();
users.getCities(provinceId);
users.getExpireDate();
FAQs
Melipayamak Nodejs samples code
The npm package melipayamak-api receives a total of 3 weekly downloads. As such, melipayamak-api popularity was classified as not popular.
We found that melipayamak-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.