title | topic | type | typeOrder |
---|---|---|---|
Send SMS |
sms |
how-to |
1 |
This example shows how you can send text and binary SMSes. In order to send SMSes your credentials need to have the
sms.send.to_subscriber
and sms.send.from_subscriber
rights. You can configure your credentials in Console.
Send SMS from international number to international number.
grpcurl \
-H "Authorization: Basic ${OPERATOR_TOKEN}"\
-import-path . \
-proto wgtwo/sms/v0/sms.proto \
-d '
{
"content": "My SMS content",
"fromTextAddress": {
"textAddress": "Test"
},
"toSubscriber": {
"e164": "47xxxxxxxx"
}
}
' \
api.wgtwo.com:443 \
wgtwo.sms.v0.SmsService/SendTextToSubscriber
Unfortunately, grpcurl
only allows to send JSON formatted strings, so it can't be used to send binary SMS.
Please have a look at the code example for Java / Kotlin below.
Then you can add sms-grpc
and utils-grpc
: