Sending SMS via OwnerSms/SendSms API

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:

  1. Combine the login and password in the format:
    username:password (e.g., admin:dsdsds)

  2. 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

  3. 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

Parameter

Description

!LOGIN!

Login of the account used to send the SMS

!PASS!

Password for the above login

!FROM!

Sender number or ID

!TO!

Recipient's phone number

!TEXT!

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"
}'