Here you will see just a sample usage of sending an SMS, for more instructions (including methods for user verification) check out our official Java documentation.
java-textflow-client uses Maven. At present the jars are available from a public maven repository.
Use the following dependency in your project to grab via Maven:
<dependency>
<groupId>me.textflow</groupId>
<artifactId>client</artifactId>
<version>1.0.2</version>
</dependency>
To send an SMS, you have to create an API key using the Textflow dashboard. When you register an account, you automatically get an API key with one free SMS which you can send anywhere.
import me.textflow.TextFlowClient;
...
TextFlowClient textFlowClient = new TextFlowClient("YOUR_API_KEY");
textFlowClient.sendSMS("+3811231234", "Message body...");
var result = textFlowClient.sendSMS("+3811231234", "Message body...");
System.out.println(result.getMessage());
result
is an instance of TextFlowSendMessageResult
, which has the appropriate getters.
{
"ok": true,
"status": 200,
"message": "Message sent successfully",
"data": {
"to": "+381611231234",
"content": "Dummy message text...",
"countryCode": "RS",
"price": 0.05,
"timestamp": 1674759108881
}
}
result
is an instance of TextFlowSendMessageResult
, which has the appropriate getters.
{
"ok": false,
"status": 404,
"message": "API key not found"
}
If you need help installing or using the library, please check the FAQ first, and contact us at support@textflow.me if you don't find an answer to your question.
If you've found a bug in the API, package or would like new features added, you are also free to contact us!