Constructor
new SmsGateway(email, password)
SmsGateway Constructor
Parameters:
Name |
Type |
Description |
email |
String
|
Account of smsgateway.me |
password |
String
|
Password of smsgateway.me |
- Source:
Methods
Create new contact
See https://smsgateway.me/sms-api-documentation/contacts/create-new-contact for detail
Parameters:
Name |
Type |
Description |
name |
String
|
Name of contact |
number |
Number
|
Number of contact |
- Source:
Returns:
-
Type
-
Promise
Get one contact
See https://smsgateway.me/sms-api-documentation/contacts/fetch-single-contact for detail
Parameters:
Name |
Type |
Description |
id |
Number
|
ID of the contact |
- Source:
Returns:
-
Type
-
Promise
Get all contacts
See https://smsgateway.me/sms-api-documentation/contacts/list-of-contacts for detail
Parameters:
Name |
Type |
Description |
page |
Number
|
page number(500 results per page) |
- Source:
Returns:
-
Type
-
Promise
getDevice(id) → {Promise}
Get one device
See https://smsgateway.me/sms-api-documentation/devices/fetch-single-device for detail
Parameters:
Name |
Type |
Description |
id |
Number
|
ID of the device |
- Source:
Returns:
-
Type
-
Promise
getDevices(page) → {Promise}
Get all devices
See https://smsgateway.me/sms-api-documentation/devices/list-of-devices for detail
Parameters:
Name |
Type |
Description |
page |
Number
|
page number(500 results per page) |
- Source:
Returns:
-
Type
-
Promise
getMessage(id) → {Promise}
Get one message
See https://smsgateway.me/sms-api-documentation/messages/fetch-single-message for detail
Parameters:
Name |
Type |
Description |
id |
Number
|
ID of the message |
- Source:
Returns:
-
Type
-
Promise
getMessages(page) → {Promise}
Get all messages
See https://smsgateway.me/sms-api-documentation/messages/list-of-messages for detail
Parameters:
Name |
Type |
Description |
page |
Number
|
page number(500 results per page) |
- Source:
Returns:
-
Type
-
Promise
send(number, message, deviceId, options) → {Promise}
Send messages
Base method of .sendMessageToNumber() / .sendMessageToManyNumbers()
Parameters:
Name |
Type |
Description |
number |
Number
|
Array
|
The number(s) to send |
message |
String
|
Message content to send |
deviceId |
Number
|
ID of device which sends this message |
options |
Object
|
Other options
Properties
Name |
Type |
Description |
send_at |
Number
|
Time(stamp) to send the message |
expires_at |
Number
|
Time(stamp) to give up trying to send the message |
|
- Source:
Returns:
-
Type
-
Promise
sendManyMessages(data) → {Promise}
Send message to contact
See https://smsgateway.me/sms-api-documentation/messages/send-many-messages-to-many-recipients for detail
Parameters:
Name |
Type |
Description |
data |
Array
|
All messages array |
- Source:
Returns:
-
Type
-
Promise
Send message to contact
See https://smsgateway.me/sms-api-documentation/messages/send-message-to-contact for detail
Parameters:
Name |
Type |
Description |
contact |
Number
|
ID of contact |
message |
String
|
Message content to send |
deviceId |
Number
|
ID of device which sends this message |
options |
Object
|
Other options
Properties
Name |
Type |
Description |
send_at |
Number
|
Time(stamp) to send the message |
expires_at |
Number
|
Time(stamp) to give up trying to send the message |
|
- Source:
Returns:
-
Type
-
Promise
Send message to contact
See https://smsgateway.me/sms-api-documentation/messages/send-message-to-many-contacts for detail
Please note: the offcial example of PHP SDK on this method is incorrect!!
Parameters:
Name |
Type |
Description |
contact |
Array
|
IDs of contact |
message |
String
|
Message content to send |
deviceId |
Number
|
ID of device which sends this message |
options |
Object
|
Other options
Properties
Name |
Type |
Description |
send_at |
Number
|
Time(stamp) to send the message |
expires_at |
Number
|
Time(stamp) to give up trying to send the message |
|
- Source:
Returns:
-
Type
-
Promise
sendMessageToManyNumbers(number, message, deviceId, options) → {Promise}
Send message to number
See https://smsgateway.me/sms-api-documentation/messages/send-message-to-many-numbers for detail
Alias to .send() method
Parameters:
Name |
Type |
Description |
number |
Array
|
The numbers to send |
message |
String
|
Message content to send |
deviceId |
Number
|
ID of device which sends this message |
options |
Object
|
Other options
Properties
Name |
Type |
Description |
send_at |
Number
|
Time(stamp) to send the message |
expires_at |
Number
|
Time(stamp) to give up trying to send the message |
|
- Source:
Returns:
-
Type
-
Promise
sendMessageToNumber(number, message, deviceId, options) → {Promise}
Send message to number
See https://smsgateway.me/sms-api-documentation/messages/send-message-to-number for detail
Alias to .send() method
Parameters:
Name |
Type |
Description |
number |
Number
|
The number to send |
message |
String
|
Message content to send |
deviceId |
Number
|
ID of device which sends this message |
options |
Object
|
Other options
Properties
Name |
Type |
Description |
send_at |
Number
|
Time(stamp) to send the message |
expires_at |
Number
|
Time(stamp) to give up trying to send the message |
|
- Source:
Returns:
-
Type
-
Promise