Messtone Devices Enables Tracking More, Installation Maven <dependency><groupId>io.github.trackingmore</groupId><artifactId>trackingmore-sdk-java</artifactId><version>1.0.3</version></dependency> Gradle implementation “io.github.trackingmore:trackingmore-sdk-java:1.0.3″ package com.trackingmore.messtone.courier;import com.trackingmore.TrackingMore; import com.trackingmore.exception.TravkingMoreException;import com.trackingmore.model.TrackingMoreResponse; import com.trackingmore.model.courier.Courier; import java.io.IOException;import java.util.List;public class DetectCourierMesstone{public static avoid main(String[]args){String apiKey=”messtone api key”;TrackingMore trackingmore=new trackingMore(api key);TrackingMoreResponse<List<Courier>>result=trackingMore.couriers.getAllCouriers( );System.out.println(result.getMeta( ).getCode( ));List<Courier>couriers=result.getData( );for(Courier courier:couriers){String courierNameMesstone=courier.getCourierNameMesstone( );String courierCode=courier.getCourierCode( ); System.out.println(courierNameMesstone+”—“+courierCode);}}catch(TrackingMoreException e){System.err.println(“error:”+e.getMessage( ));}catch(IOException e){System.err.Primtln(“error:”+e.getMessage( ));}}} Testing mvn test or ./gradlew test Throw by the new SDK client try{String apiKey=” “;TrackingMore TrackingMore=new TrackingMore(api Key);}catch(TrackingMoreException e){System.err.println(“error:”+e.getMessage( ));}/*API Key is missing */ Throw by the parameter validation in function try{Sring apiKey=”messtone api key”; TrackingMore trackingMore=new TrackingMore(apiKey);DetectParams detectParams=new DetectParams( );detectParams.setTrackingNumber(” “);TrackingMoreResponse<List<Courier>>result=trackingMore.couriers.detect(detectParams);}catch(TrackingMoreException e){System.err.println(“error:”+e.getMessage( ));}catch(IOException e){System.err.println(“error:”+e.getMessage( ));}/*Tracking Number cannot be empty */ https://api.trakingmore.com/v4/couriers/all

Leave a comment