Sending SMS via OwnerSms/SendSms API
You can use the OwnerSms/SendSms
API to send SMS messages from or to the platform, depending on your SMS routing plan configuration.
🔐 Authentication
It is recommended to create a separate VSM4 user for API access.
To generate a Basic Authentication token:
Combine the
login
andpassword
in the format:username:password
(e.g.,admin:dsdsds
)Use Notepad++ with the MIME Tools plugin to Base64 encode this string:
Select
admin:dsdsds
From the top menu, go to:
Plugins → MIME Tools → Base64 Encode with padding
This will produce a string like:
YWRtaW46ZHNkc2Rz
Use the encoded string in the Authorization
header as follows:
Authorization: Basic YWRtaW46ZHNkc2Rz
Example curl
Request
curl 'https://server_domain_name/vsm4/api/OwnerSms/SendSms' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46ZHNkc2Rz' \
--data-raw '{
"login": "!LOGIN!",
"password": "!PASS!",
"from": "!FROM!",
"to": "!TO!",
"message": "!TEXT!"
}'
Parameters:
Parameter | Description |
---|
| Login of the account used to send the SMS |
| Password for the above login |
| Sender number or ID |
| Recipient's phone number |
| SMS message content |
Example with Real Parameters
curl 'https://server_domain_name/vsm4/api/OwnerSms/SendSms' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46ZHNkc2Rz' \
--data-raw '{
"login": "marcin",
"password": "gkpgm190o",
"from": "Lukas",
"to": "48777888999",
"message": "TEST"
}'