Using this Node.js REST-ful API you'll be able to send SMS using multiple services.
Number | website |
---|---|
1 | https://sms.ir |
2 | http://melipayamak.com |
3 | https://kavenegar.com/ |
Add your web service info to ./gateways/gateways.json
"YourWebserviceName" : {
"name": "YourWebserviceName",
"localName" : "نام وب سرویس شما",
"developer": "@yourGithubId",
"website": "http://domain.com",
"logo": "/logos/YourWebserviceName.png",
"country": "IR",
"AuthType" : 1
}
Some web services only requires token to authorize and some of them requires username and password, you can specify Auth type using this numbers:
Number | Type |
---|---|
1 | Token |
2 | User Pass |
3 | Other |
You can check this types in your client and ask user to register token or username & password.
After that
Add YourWebserviceName.js to './gateways' - its name must be that name what you added to gateways.json file:
And use ./gateways/sample js for writing your codes.
- Clone this project
git clone https://github.com/raychat/sms-service.git
- Go to project directory
- Install dependencies
npm install
- Then
node index.js
- Send SMS
POST /sendSms
Field | Type | * | Description |
---|---|---|---|
auth | string or object | required | your auth data(depends on your web service it can be an object or a string) |
message | string | required | message |
sender | string | required | sender number |
receptor | string | required | receptor number |
gateway | string | required | web service name |
- Get account information
POST /getInfo
Field | Type | * | Description |
---|---|---|---|
auth | string or object | required | your auth data(depends on your web service it can be an object or a string) |
gateway | string | required | web service name |