Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.88 KB

sms-send-how-to.md

File metadata and controls

69 lines (51 loc) · 1.88 KB
title topic type typeOrder
Send SMS
sms
how-to
1

How to send SMS

Overview

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.

grpcurl

Send text SMS

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

Send binary SMS

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.

Java / Kotlin

Install dependencies

Then you can add sms-grpc and utils-grpc:

Send text SMS

Send binary SMS

Resources

Concepts