Migrating to Versioned Java SDK

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.

Migration to versioned SDK

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 @Deprecated, and will be removed with the next major release. With fewer layers, the SDK decreases memory consumption and increases performance.

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.

Client

Product Un-versioned Versioned
Verification client.verification() client.verification().v1()

Verification

In addition to the table below, you can review the corresponding synatx reference guide and API reference guide.

Verifications

Un-versioned Versioned
reportCallout-
ById
VerificationReportCallout reportCalloutById(VerificationId, VerificationReportCalloutRequestParameters) VerificationReportResponsePhoneCall reportPhoneCallById(String, VerificationReportRequestPhoneCall)
reportCallout-
ByIdentity
VerificationReportCallout reportCalloutByIdentity(NumberIdentity, VerificationReportCalloutRequestParameters) VerificationReportResponsePhoneCall reportPhoneCallByIdentity(NumberIdentity, VerificationReportRequestPhoneCall)
reportFlashCall-
ById
VerificationReportFlashCall reportFlashCallById(VerificationId, VerificationReportFlashCallRequestParameters) VerificationReportResponseFlashCall reportFlashCallById(String, VerificationReportRequestFlashCall)
reportFlashCall-
ByIdentity
VerificationReportFlashCall reportFlashCallByIdentity(NumberIdentity, VerificationReportFlashCallRequestParameters) VerificationReportResponseFlashCall reportFlashCallByIdentity(NumberIdentity, VerificationReportRequestFlashCall)
reportSmsById VerificationReportSMS reportSmsById(VerificationId, VerificationReportSMSRequestParameters) VerificationReportResponseSms reportSmsById(String, VerificationReportRequestSms)
reportSmsByIdentity VerificationReportSMS reportSmsByIdentity(NumberIdentity, VerificationReportSMSRequestParameters) VerificationReportResponseSms reportSmsByIdentity(NumberIdentity, VerificationReportRequestSms)
startCallout StartVerificationResponseCallout startCallout(StartVerificationCalloutRequestParameters) VerificationStartResponsePhoneCall startPhoneCall(VerificationStartRequestPhoneCall parameters)
startFlashCall StartVerificationResponseFlashCall startFlashCall(StartVerificationFlashCallRequestParameters) VerificationStartResponseFlashCall startFlashCall(VerificationStartRequestFlashCall parameters)
startSeamless StartVerificationResponseSeamless startSeamless(StartVerificationSeamlessRequestParameters) VerificationStartResponseData startData(VerificationStartRequestData parameters)
startSms StartVerificationResponseSMS startSms(StartVerificationSMSRequestParameters) VerificationStartResponseSms startSms(VerificationStartRequestSms parameters)

Verification Status

Un-versioned Versioned
getById VerificationReport getById(VerificationId id) VerificationStatusResponse getById(String id)
getByIdentity VerificationReport getByIdentity(NumberIdentity identity, VerificationMethodType method) VerificationStatusResponse getByIdentity(NumberIdentity identity, VerificationMethod method)
getBy-
Reference
VerificationReport getByReference(VerificationReference reference) VerificationStatusResponse getByReference(String reference)

Webhooks

Un-versioned Versioned
parseEvent VerificationEvent parseEvent(String) VerificationEvent parseEvent(String)
serializeResponse String serializeResponse(VerificationResponse) String serializeResponse(VerificationRequestEventResponse)
validateAuthenticationHeader boolean validateAuthenticationHeader(String String, Map<String,String>, String) boolean validateAuthenticationHeader(String, String path, Map<String,String>, String)
We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.