Sinch offers a Unified Java SDK (com.sinch.sdk.sinch-sdk-java). This guide provides information on how to migrate from the initial release of the Sinch Unified Java SDK to the versioned release.
The initial Sinch Unified Java SDK was based on adapter layers; each programmatic API required its own business logic.
To reduce overhead and complexity, the SDK implemented "versioned" layers with v1.5.
To provide a smooth transition, the un-versioned APIs are still supported. However, they will be tagged as
, and will be removed with the next major release. With fewer layers, the SDK decreases memory consumption and increases performance.@Deprecated
The versioned APIs are accessible from domains within the SinchClient
(e.g. client.sms()
) for SMS, but with an added vX
suffix pointing to the version namespace.
For example, previous calls to client.sms().batches()
(using the inital, un-versioned SDK) are now available by addressing client.sms().v1().batches()
(using the first versioned SDK). This also impacts packages and classes names.
Tables providing mappings between un-versioned calls and versioned calls are below. The corresponding JavaDocs are linked for easy reference.
Product | Un-versioned | Versioned |
---|---|---|
Numbers | client.numbers() | client.numbers().v1() |
In addition to the table below, you can review the corresponding synatx reference guide and API reference guide.
| | Un-versioned | Versioned | | |------------- |---------- | | checkAvail-
ability | AvailableNumbercheckAvailability(String phoneNumber)
| AvailableNumber checkAvailability(String)
| | list | AvailableNumberListResponse list(AvailableNumberListAllRequestParameters parameters)
| AvailableNumberListResponse searchForAvailableNumbers(AvailableNumberListRequest)
| | rent | ActiveNumber rent(String phoneNumber, AvailableNumberRentRequestParameters parameters)
| ActiveNumber rent(String, AvailableNumberRentRequest)
| | rentAny | ActiveNumber rentAny(AvailableNumberRentAnyRequestParameters parameters)
| ActiveNumber rentAny(AvailableNumberRentAnyRequest)
|
| | Un-versioned | Versioned | | | ------------ | --------- | | list | AvailableRegionListResponse list(AvailableRegionListAllRequestParameters)
| AvailableRegionListResponse list(AvailableRegionListRequest)
|
| | Un-versioned | Versioned | | | ------------ | --------- | | get | CallbackConfiguration get()
| CallbackConfigurationResponse get()
| | update | CallbackConfiguration update(CallbackConfigurationUpdateRequestParameters)
| CallbackConfigurationResponse update(CallbackConfigurationUpdateRequest)
|
| | Un-versioned | Versioned | | |------------- |---------- | | unserializeEventNotification | EventNotification unserializeEventNotification(String)
| NumberEvent parseEvent(String)
| | validate | N/A | boolean validateAuthenticationHeader(String, Map<String,String>, String)
|