Kotlin
Welcome to the ReSMS kotlin integration guide.
This guide explains how you can quickly and securely send SMS messages using the ReSMS API in your Kotlin applications.
Installation
First, install our official ReSMS Kotlin SDK:
maven :
<dependency>
<groupId>org.resms</groupId>
<artifactId>sdk</artifactId>
<version>1.0.0</version>
</dependency>
Gradle (Kotlin DSL):
implementation("org.resms:sdk:1.0.0")
Setup
You need to get an API key on ReSMS Dashboard .
Then import the package and create a new instance of the ReSMS
class with your API key.
import resms;
val client: ReSMS = ReSMS("re_12345")
or
import resms;
val client: ReSMS = ReSMS("re_12345", 10) //timeout in seconds
Quickstart
Here’s a minimal example to send an SMS:
import resms;
val client: ReSMS = ReSMS("re_12345")
// Easiest way
val response1: SendSmsResponse = client.send("+33123456789", "Hello World!")
// By using SendSmsRequest class
val request = SendSmsRequest("+33123456789", "Hello World!")
val response2: SendSmsResponse = client.send(request)
Going Further
Need help? Contact our support at contact@resms.dev
Last updated on