Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deploy
Refer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.snapcx</groupId>
<artifactId>tracking-client</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "io.snapcx:tracking-client:1.0.1"
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/tracking-client-1.0.1.jar
- target/lib/*.jar
curl -X GET -H "user_key: 817d94a03dd15c0d5782686aae84974c" "https://api.snapcx.io/tracking/v1/getTrackingDetails?carrier=FEDEX&trackId=074347350384592"
curl -X GET -H "user_key: 817d94a03dd15c0d5782686aae84974c" "https://api.snapcx.io/tracking/v1/getTrackingDetails?carrier=UPS&trackId=1Z884AR10211041421"
Please follow the installation instruction and execute the following Java code:
import io.snapcx.tracking.client.*;
import io.snapcx.tracking.client.auth.*;
import io.snapcx.tracking.client.model.*;
import io.snapcx.tracking.client.api.ShippingApi;
import java.io.File;
import java.util.*;
public class ShippingApiExample {
public static void main(String[] args) {
ShippingApi apiInstance = new ShippingApi();
String carrier = "carrier_example"; // String | Shipper Carrier code (UPS or USPS or FEDEX or DHL Or CAN (Canada Post) OR use AUTO for automatic detection.).
String trackId = "trackId_example"; // String | Carrier tracking number, which is being tracked.
String userKey = "userKey_example"; // String | Your private key, given after opening account with snapcx.io
try {
InlineResponse200 result = apiInstance.getTrackingDetails(carrier, trackId, userKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ShippingApi#getTrackingDetails");
e.printStackTrace();
}
}
}
All URIs are relative to https://api.snapcx.io
Class | Method | HTTP request | Description |
---|---|---|---|
ShippingApi | getTrackingDetails | GET /tracking/v1/getTrackingDetails | Get Shipping Tracking Details |
All endpoints require API KEY in request header. You can get your api key from developer portal of snapcx.io. Name of header key is user_key Example
user_key:d111120ba53b07fxxxx05bc8c754a33f
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issue.
(You can use your API Key to test API end point) https://snapcx.io/shippingTrackingAPI