Here you'll find documentation to start developing Java code using Sinch services.
To use this SDK you'll need a Sinch account and API keys. Please sign up at sinch.com
For more in depth version of the Sinch APIs, please refer to the official developer portal - developers.sinch.com
This SDK is currently available to selected developers for preview use only. It is being provided for the purpose of collecting feedback, and should not be used in production environments.
- JDK 8 or later
- Maven
- Maven Central
- Sinch account
Add to your pom.xml
file the dependency to SDK:
<dependencies>
<dependency>
<groupId>com.sinch.sdk</groupId>
<artifactId>sinch-java-sdk</artifactId>
<version>${sdk.version}</version>
</dependency>
...
</dependencies>
To initialize communication with Sinch backed, credentials obtained from Sinch portal have to be provided to the main client class of this SDK. It's highly advised to not hardcode those credentials, but to fetch them from environment variables:
import com.sinch.sdk.SinchClient;
import com.sinch.sdk.models.Configuration;
...
Configuration configuration = Configuration.builder().setKeyId(PARAM_KEY_ID)
.setKeySecret(PARAM_KEY_SECRET)
.setProjectId(PARAM_PROJECT_ID)
.build();
...
SinchClient client = new SinchClient(configuration);
Sinch client provides access to the following Sinch products:
Usage example of the numbers
product:
AvailableNumberListResponse response = client
.numbers()
.available()
.list(AvailableNumberListAllRequestParameters.builder()
.setRegionCode("US")
.setType(NumberType.LOCAL)
.build());
The SDK uses the Java 8 logging feature (java.util.logging)
Loggers and severity can be configured by using a logging.properties
file like (see sample-app/src/main/resources/:
handlers = java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = INFO
com.sinch.sdk.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] [%4$-7s %2$s] %5$s %n
See sample-app module
See HTTP-CLIENT file
See ARCHITECTURE file
This project is licensed under the Apache License. See the LICENSE file for the license text.