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.
sms-ir-api
Advanced tools
Readme
sms-ir-api
allows you to communicate with the SMS.ir API to send and receive SMS messages. The API key and default line number for your SMS.ir account are required to create a new instance of the Smsir class.
This package is available on npm as sms-ir-api
. You can install it using either npm or yarn.
With npm:
npm install sms-ir-api
With yarn:
yarn add sms-ir-api
To use this class in your JavaScript or TypeScript code, first import it:
import { Smsir } from "sms-ir-api";
Then create a new instance of the Smsir class using your SMS.ir API key and default line number:
const sms = new Smsir("YOUR_API_KEY", YOUR_LINE_NUMBER);
You can then use the methods of the Smsir class to interact with the SMS.ir API. For example, to send a single SMS message to a single recipient:
sms.Send("Hello World!", "RECIPIENT_MOBILE_NUMBER");
The following methods are available in the Smsir class:
constructor(apiKey: string, lineNumber: number)
Create a new instance of the Smsir class.
apiKey
: The API key for your SMS.ir account.lineNumber
: The default line number to use for sending messages.const sms = new Smsir("YOUR_API_KEY", YOUR_LINE_NUMBER);
Send(MessageText: string, Mobile: string, SendDateTime: number | null = null, lineNumber: number = this.DefaultLineNumber): Promise<any>
Send a single SMS message to a single recipient.
MessageText
: The text of the message to send.Mobile
: The mobile number of the recipient.SendDateTime
: (optional) The Unix timestamp of when to send the message (null for immediate sending).lineNumber
: (optional) The line number to use for sending the message.sms.Send("Hello World!", "RECIPIENT_MOBILE_NUMBER");
SendBulk(MessageText: string, Mobiles: Array<string>, SendDateTime: number | null = null, lineNumber: number = this.DefaultLineNumber): Promise<any>
Send a single SMS message to multiple recipients.
MessageText
: The text of the message to send.Mobiles
: An array of mobile numbers of the recipients.SendDateTime
: (optional) The Unix timestamp of when to send the message (null for immediate sending).lineNumber
: (optional) The line number to use for sending the message.sms.SendBulk("Hello World!", ["RECIPIENT_MOBILE_NUMBER_1", "RECIPIENT_MOBILE_NUMBER_2"]);
SendLikeToLike(MessageTexts: string, Mobiles: Array<string>, SendDateTime: number | null = null, lineNumber: number | null = null): Promise<any>
Send multiple SMS messages to multiple recipients (one message per recipient).
MessageTexts
: The text of the messages to send.Mobiles
: An array of mobile numbers of the recipients.SendDateTime
: (optional) The Unix timestamp of when to send the message (null for immediate sending).lineNumber
: (optional) The line number to use for sending the message (null for default line number).sms.SendLikeToLike(["Hello World 1!", "Hello World 2!"], ["RECIPIENT_MOBILE_NUMBER_1", "RECIPIENT_MOBILE_NUMBER_2"]);
DeleteScheduled(PackId: number): Promise<any>
Delete a scheduled SMS message.
PackId
: The ID of the scheduled message pack to delete.sms.DeleteScheduled(SCHEDULED_MESSAGE_PACK_ID);
SendVerifyCode(Mobile: string, TemplateId: number, Parameters: Array<any>): Promise<any>
Send a verification code via SMS.
Mobile
: The mobile number of the recipient.TemplateId
: The ID of the verification code template to use.Parameters
: An array of parameters to use in the verification code template.sms.SendVerifyCode("RECIPIENT_MOBILE_NUMBER", TEMPLATE_ID, [PARAMETER_1, PARAMETER_2]);
ReportMessage(MessageId: number): Promise<any>
Get a report on a specific sent SMS message.
MessageId
: The ID of the sent message to get a report on.sms.ReportMessage(MESSAGE_ID);
ReportPack(PackId: number): Promise<any>
Get a report on a specific sent SMS message pack.
PackId
: The ID of the sent message pack to get a report on.sms.ReportPack(PACK_ID);
ReportToday(pageSize: number = 10, pageNumber: number = 1): Promise<any>
Get a report on today's sent SMS messages.
pageSize
: (optional) The number of results to return per page.pageNumber
: (optional) The page number to return results for.sms.ReportToday(PAGE_SIZE, PAGE_NUMBER);
ReportArchived(fromDate: number | null = null, toDate: number | null = null, pageSize: number = 10, pageNumber: number = 1): Promise<any>
Get a report on archived sent SMS messages.
fromDate
: (optional) The start date to get results for (null for no start date).toDate
: (optional) The end date to get results for (null for no end date).pageSize
: (optional) The number of results to return per page.pageNumber
: (optional) The page number to return results for.sms.ReportArchived(FROM_DATE, TO_DATE, PAGE_SIZE, PAGE_NUMBER);
ReportLatestReceived(count: number = 100): Promise<any>
Get a report on the latest received SMS messages.
count
: (optional) The number of results to return.sms.ReportLatestReceived(COUNT);
ReportTodayReceived(pageSize: number = 10, pageNumber: number = 1): Promise<any>
Get a report on today's received SMS messages.
pageSize
: (optional) The number of results to return per page.pageNumber
: (optional) The page number to return results for.sms.ReportTodayReceived(PAGE_SIZE, PAGE_NUMBER);
ReportArchivedReceived(fromDate: number | null = null, toDate: number | null = null, pageSize: number = 10, pageNumber: number = 1): Promise<any>
Get a report on archived received SMS messages.
fromDate
: (optional) The start date to get results for (null for no start date).toDate
: (optional) The end date to get results for (null for no end date).pageSize
: (optional) The number of results to return per page.pageNumber
: (optional) The page number to return results for.sms.ReportArchivedReceived(FROM_DATE, TO_DATE, PAGE_SIZE, PAGE_NUMBER);
GetCredit(): Promise<any>
Get the remaining credit balance for your SMS.ir account.
sms.GetCredit();
GetLineNumbers(): Promise<any>
Get a list of available line numbers for your SMS.ir account.
sms.GetLineNumbers();
Developed by Shahab Movahhedi
MIT Licensed.
FAQs
SMS.IR API client for JS/TS/ESM/Node.js
The npm package sms-ir-api receives a total of 0 weekly downloads. As such, sms-ir-api popularity was classified as not popular.
We found that sms-ir-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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.