Skip to content

4.0.0

Compare
Choose a tag to compare
@ib-fsrnec ib-fsrnec released this 02 Mar 12:01
· 20 commits to master since this release
1d8c5d7

[ 4.0.0 ] - 2023-03-02

🎉 NEW Major Version of infobip-api-java-client.

⚠️ IMPORTANT NOTE: This release contains breaking changes.
All changes, including breaking changes, are addressed and explained in the list bellow.
If you find out that something was not addressed properly, please submit an issue.

Added

  • Support for Infobip MMS API.
  • Support for Infobip Voice API.
  • Support for Infobip WebRTC API.
  • Support for Infobip Viber API.
  • Most recent Infobip SMS API feature set.
  • Most recent Email feature set.
  • Most recent WhatsApp feature set.
  • Tests for the static parts of the auto-generated code.
    There are multiple tests phases implemented in our auto-generation pipeline.
    A part of the tests is now included as a library source code.
  • Base URL abstraction.
  • Api Key abstraction.
  • Deprecation notice log if deprecated or gone endpoints are used (slf4j-api dependency).
  • Snyk and Java version badges to README.

Changed

  • The library now requires Java 11 or above.
  • OkHttp dependency was bumped to version 4.10.0.
  • From this version, an ApiClient instance must be constructed and configured using the Builder pattern:
        ApiClient apiClient = ApiClient.forApiKey(givenApiKey)
              .withBaseUrl(givenBaseUrl)
              .withHttpClient(givenHttpClient)
              .withReadTimeout(givenReadTimeoutInSeconds)
              .withTempDirectoryPath(givenTempDirPath)
              .build();
    
    The additional OkHttp client configuration was removed from the library.
    Please check the Removed section for details.
  • API classes were refactored in a way that all functionalities are grouped under the same product.
    For example, SendSmsApi, ScheduledSmsApi and ReceiveSmsApi classes are replaced with a single SmsApi class.
  • API class methods that trigger an API call were rewritten using a fluent style where all required parameters
    must be passed to a request builder factory method.
    On the other hand, optional parameters may be passed using a separate request builder methods.
    The result can be fetched using execute or executeAsync methods.
    That allows us to add optional parameters without introducing a breaking change to the library.
    For example, in the previous version, to send a TFA pin code, we could use something like this:
        TfaStartAuthenticationResponse response = tfaApi.sendTfaPinCodeOverSms(false, request);
    
    In the new version, the following pattern applies:
        TfaStartAuthenticationResponse sendCodeResponse = tfaApi
              .sendTfaPinCodeOverSms(request)
              .ncNeeded(false)
              .execute();
    
  • Jackson (version 2.14.2) serialization library is used instead of Gson.
    The JSON serialization utility now uses a preconfigured Jackson's ObjectMapper.
    Also, the support for InputStream serialization was added.
  • All maven plugins were bumped to the most recent version.
    Both unneeded plugins and the obsolete configuration were removed.
  • The API request and response processing was rewritten to increase maintainability and usability.
  • The ApiException class was refactored to have fluent getters and a single accessible Builder.
  • From this version, the error response body is deserialized and stored in details property of the ApiException class.
  • The palantir-java-format is now used instead of google-java-format to have the formatting closer to our internal coding style.
    See the Spotless README for details.
  • Some products like Email and WhatsApp contain a few breaking changes since a new version of a few of the API endpoints was released.
    If you have issues when migrating the existing implementation, please check the official API documentation or submit an issue.

Removed

  • Basic, IBSSO Token Header and client credentials grant type OAuth2 authentication methods.
    Use API Key Header authentication method instead.
    The API Key should be injected into the ApiClient instance through the newly introduced forApiKey factory method.
    Examples can be found in the README.
  • Configuration utility class.
    Having static default configuration is error-prone and provides an unnecessary overhead.
    An ApiClient instance should always be injected in the given API class.
  • SSL settings configuration methods from the ApiClient.
    If you need to configure custom SSL related settings (custom client keys, disabled CA certificate and hostname verification, etc.),
    configure them on the OkHttpClient instance directly and pass the instance to the ApiClient using withHttpClient builder method.
  • Date format customization methods from the ApiClient.
    Only the default Infobip date format should be used.
    The date formatter instance to be used is available through the JSON class.
  • Header and cookie manipulation through ApiClient public interface.
    However, it can still be achieved using OkHttp interceptors if needed.
    Feel free to configure an OkHttpClient instance with appropriate interceptors and pass the instance to the ApiClient using withHttpClient builder method.
  • Explicit debugging option for ApiClient.
    HttpLoggingInterceptor can always be included by providing a preconfigured HTTP client as described above.
  • Explicit gzip support for requests.
    The support should be provided by the client itself like explained here.
  • Unused generated classes.
  • Default network interceptor used for tracking upload and download progress.
    The functionality can be re-added by using the official OkHttp recipe.
  • ...WithHttpInfo methods from API client classes.
    If an additional info like response headers or the response code is needed, the executeAsync method should be
    used.
    The required information is injected in the callback.
  • ...buildCall methods from API client classes.
    The OkHttp Call abstraction can be obtained by using the executeAsync method.
    We don't allow calling the API without processing the response internally anymore.