Before you start
- You need Java 17+ installed on your machine.
- You need a Rewrite API key with the required permissions.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Learn how to use the Java SDK to send SMS with the API.
<dependency>
<groupId>io.github.rewritetoday</groupId>
<artifactId>rewrite-java</artifactId>
<version>x.y.z</version>
</dependency>
implementation("io.github.rewritetoday:rewrite-java:x.y.z")
REWRITE_API_KEY=rw...
import com.rewritetoday.sdk.Rewrite;
import com.rewritetoday.sdk.models.messages.SendOptions;
public class Main {
public static void main(String[] args) throws Exception {
var rewrite = new Rewrite(System.getenv("REWRITE_API_KEY"));
var params = SendOptions.builder()
.to("+1234567890")
.content("Your OTP code is 478201")
.build();
var message = rewrite.messages().send(params);
System.out.println(message);
}
}