Skip to content

Releases: smartcar/java-sdk

v3.0.0

12 Jul 17:10
8be00ee
Compare
Choose a tag to compare

Release Notes

This is a major release consisting of multiple usability improvements and additional features.

We have aimed to streamline the SDK with the Smartcar API interfaces in a way that the objects returned are closer to the API interface documented in API Docs. For ex. vehicle.odometer() will now return an object that looks like the response in the documentation and additionally the body will contain response headers defined in the documentation as a part of a meta attribute.

The methods to be used are broadly divided into three namespaces :

  • AuthClient - This class is used for all OAuth related operations
  • Smartcar - This class is used for all application level operations
  • Vehicle - This class is used for all vehicle operations/actions.

Features

  • Environment variables - The SDK now supports usage of environment variables for client id (SMARTCAR_CLIENT_ID), client secret(SMARTCAR_CLIENT_SECRET) and redirect URL(SMARTCAR_REDIRECT_URL). These can be used instead of having to pass these as arguments.
  • hashChallenge - Additional utility method defined in Smartcar namespace to generate hash challenge for webhooks.
  • verifyPayload - Additional utility method defined in Smartcar namespace to verify the payload returned by webhooks.
  • getApiVersion - Method defined in Smartcar namespace to return the api version set globally.
  • subscribe - Additional method defined in Vehicle namespace to subscribe to a webhook.
  • unsubscribe - Additional method defined in Vehicle namespace to unsubscribe from a webhook.
  • Default API version to 2.0 - The default version for the APIs is now 2.0 instead of 1.0 . This can be overridden globally by using the setApiVersion method or by using optional arguments in different methods.
  • Smartcar Data Types - The SmartcarResponse class has be retired in favor of individual data types such as VehicleOdometer. Instead of SmartcarResponse<VehicleOdometer>, use VehicleOdometer.

Improvements

Following are the improvements made to the interfaces by namespace. For in-depth details of the interface please refer to the documentation of the functions generated here

AuthClient

  • Builder - This builds an AuthClient class using the set of parameters required by all of the functions defined in the class
  • getAuthUrlBuilder - Takes in scope as required argument and all the other optional arguments required to generate the Smartcar Connect URL as defined in the docs
  • exchangeCode - Added additional support for optional flags parameter for future usage via the SmartcarAuthOptions.
  • exchangeRefreshToken - Added additional support for optional flags parameter for future usage via the SmartcarAuthOptions.

Smartcar

  • getVehicles - Renamed from getVehicleIds and changes in interface.
  • getUser - Moved and renamed from Vehicle#getUserIds and changes in interface.
  • getCompatibility - Moved and renamed from AuthClient#isCompatible and changes in interface including adding testMode and testModeCompatibilityLevel available via SmartcarCompatibilityRequest.

Vehicle

  • Constructor - Updated to now support a version parameter via the SmartcarVehicleOptions class. Look at the interface for more details.
  • attributes - Renamed from info .

SmartcarError

All the errors have been converged to a single SmartcarError class. This class can now support the error fields returned by v2.0 and v1.0. For detailed breakdown of both the error types, refer to the to the API Reference Errors section.

v2.8.2

04 May 20:56
Compare
Choose a tag to compare

2.8.2 (2021-05-04)

Summary

This version and all future versions of the SDK will be signed with a new PGP key (fingerprint 858F 2E14 844B 209E 4401 D5B4 E562 9D96 198D A92C) instead of the key that was used previously (fingerprint 839A F198 6C46 3495 A262 D873 523F 5DE4 DFCC 55FA).

Details

Codecov notified its customers on April 15th, 2021 that they "learned that someone had gained unauthorized access to our Bash Uploader script and modified it without our permission." The altered uploader uploaded the contents of env on the machine that was executing the script to an attacker-controlled IP address.

In our case, this means that the attacker might have obtained access to the private PGP key that we used to sign releases of our Java SDK and Android SDK and the credentials that we used to push release artifacts to Maven Central. We have no reason to believe that the key or credentials were used maliciously*. Nonetheless, we have rotated our credentials, published a revocation certificate for our PGP key, and switched over to a new key to ensure that all future releases continue to be secure and signed by a trusted key.

Links to the new PGP Key

Links to the revoked PGP Key

*Sonatype's policy prohibits the removal or any other modification of artifacts after they have been released, so we are confident that there is no risk to using older versions of the SDK. Reference: MVNCENTRAL-6691

v2.8.1

24 Apr 02:55
Compare
Choose a tag to compare

2.8.1 (2021-04-24)

This release adds support for v2.0 of Smartcar's API by introducing the smartcar.setApiVersion method.

We have also introduced a SmartcarExceptionV2 class whose fields match the error fields returned by v2.0 of the API as documented on the API Reference. This class extends the SmartcarException class to ease the migration process.

For a detailed breakdown of the changes and how to migrate see our API Changelog for v2.0 and our v2.0 Error Guides.

v2.8.0

24 Apr 01:14
62a8843
Compare
Choose a tag to compare
v2.8.0 Pre-release
Pre-release
Travis Generated Tag

v2.7.7

10 Apr 04:02
Compare
Choose a tag to compare

2.7.7 (2021-04-09)

Features

  • switch publishing from Bintray to Maven Central (86ae36)

v2.6.3

27 Oct 23:46
8e67a84
Compare
Choose a tag to compare

With this release, the SDK will wrap unexpected errors into SmartcarException, rather than allowing other internal errors to bubble up to the client.

v2.6.2

22 Oct 01:33
Compare
Choose a tag to compare

2.6.2 (2020-10-22)

Bug Fixes

  • gradle: set Implementation-Version correctly in the JAR's manifest (1eb30cd)

Surface the SC-Request-Id HTTP response header on SmartcarException

24 Mar 21:33
1566a82
Compare
Choose a tag to compare

Smartcar HTTP responses set a header called SC-Request-Id. Each response from Smartcar’s API has a unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. See the API Reference for more details.

This release adds the SmartcarException.getRequestId() method.

Example Usage:

Vehicle vehicle = new Vehicle(vid, accessToken);

try {
    vehicle.location();
} catch (SmartcarException e) {
    System.out.println(e.getRequestId());
     // 9692f6ae-f313-4897-a5a3-6e1869d86d8a
}

BatchResponse batchRes = vehicle.batch(new String[] {"/location"});
try {
    batchRes.location();
} catch (SmartcarException e) {
    System.out.println(e.getRequestId());
     // 9692f6ae-f313-4897-a5a3-6e1869d86d8a
}

Surface the SC-Request-Id HTTP response header on BatchResponse

11 Mar 16:35
5e50ee5
Compare
Choose a tag to compare

Smartcar HTTP responses set a header called SC-Request-Id. Each response from Smartcar’s API has a unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. See the API Reference for more details.

This release adds the BatchResponse.getRequestId() method.

Example Usage:

Vehicle vehicle = new Vehicle(vid, accessToken);

BatchResponse batchRes = vehicle.batch(new String[] {"/location"});
System.out.println(batchRes.getRequestId());
// 9692f6ae-f313-4897-a5a3-6e1869d86d8a

SmartcarResponse<VehicleLocation> location = batchRes.location();
System.out.println(location.getRequestId());
// 9692f6ae-f313-4897-a5a3-6e1869d86d8a

Surface the SC-Request-Id HTTP response header on SmartcarResponse

11 Mar 16:35
7f51579
Compare
Choose a tag to compare

Smartcar HTTP responses set a header called SC-Request-Id. Each response from Smartcar’s API has a unique request identifier. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution. See the API Reference for more details.

This release adds the SmartcarResponse.getRequestId() method.

Example Usage:

Vehicle vehicle = new Vehicle(vid, accessToken);

SmartcarResponse<VehicleLocation> location = vehicle.location();
System.out.println(location.getRequestId());
// 6e1a18bb-b20e-4d5d-8dd2-537989988b65