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
Voice client.voice() client.voice().v1()

Voice

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

Applications

Un-versioned Versioned
assignNumbers void assignNumbers(ApplicationsAssignNumbersRequestParameters) void assignNumbers(UpdateNumbersRequest parameters)
getCallbackUrls CallbackUrls getCallbackUrls(String) Callbacks getCallbackUrls(String applicationKey)
listNumbers AssignedNumbers listNumbers() OwnedNumbersResponse listNumbers()
queryNumber NumberInformation queryNumber(E164PhoneNumber) QueryNumberResponse queryNumber(String number)
unassignNumber void unassignNumber(E164PhoneNumber, String) void unassignNumber(UnAssignNumberRequest parameters)
updateCallbackUrls void updateCallbackUrls(String, CallbackUrls) void updateCallbackUrls(String applicationKey, Callbacks parameters)

Callouts

Un-versioned Versioned
call String call(CalloutRequestParameter) String call(CalloutRequest parameters)
conference String conference(CalloutRequestParametersConference) String conference(CalloutRequestConference parameters)
custom String custom(CalloutRequestParametersCustom) String custom(CalloutRequestCustom parameters)
textToSpeech String textToSpeech(CalloutRequestParametersTTS) String textToSpeech(CalloutRequestTTS parameters)

Calls

Un-versioned Versioned
get CallInformation get(String) CallInformation get(String)
manageWithCallLeg void manageWithCallLeg(String, CallLegType, SVAMLControl) void manageWithCallLeg(String, CallLeg, SvamlControl)
update void update(String, SVAMLControl) void update(String, SvamlControl)

Conferences

Un-versioned Versioned
call String call(CalloutRequestParametersConference) String call(CalloutRequestConference)
get Collection get(String) GetConferenceInfoResponse get(String)
kickAll void kickAll(String) void kickAll(String)
kickParticipant void kickParticipant(String, String) void kickParticipant(String, String)
manageParticipant void manageParticipant(String, String, ConferenceManageParticipantRequestParameters) void manageParticipant(String, String, ManageConferenceParticipantRequest)

Webhooks

Un-versioned Versioned
unserializeWebhooksEvent unserializeWebhooksEvent(String) VoiceWebhookEvent parseEvent(String)
serializeWebhooksResponse String serializeWebhooksResponse(SVAMLControl) String serializeResponse(SvamlControl)
validateAuthenticatedRequest boolean validateAuthenticatedRequest(String, String, Map<String,String>, String) boolean validateAuthenticationHeader(String, String, Map<String,String>, String)
We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.