Skip to content

Latest commit

 

History

History
244 lines (204 loc) · 7.41 KB

README.md

File metadata and controls

244 lines (204 loc) · 7.41 KB

Deliveree - the Java library for the Deliveree SDK

Maven build project sdk :

clean compile assembly:single

With Deliveree SDK, developers can integrate our on-demand local delivery platform into their applications. The SDK is designed for developers to check prices, book an immediate or scheduled delivery and follow updates until delivery completion.

  • SDK version: 1.0.0-SNAPSHOT

Frameworks supported

  • Java 1.8 or later
  • Spring Boot Framework 1.5.9 or later

Dependencies

Config for sample project

# Add SDK in your project 
    Project/edit References...
    Then browse to Deliveree sdk files:
        - sdk-delivery.jar

Getting Started

Cancel Booking

package test;

import sdk_java.sdk.api.DelivereeApi;
import sdk_java.sdk.configApi.Configuration;
import sdk_java.sdk.configApi.ApiResponse;

public class test {
	public static void main(String a[]) throws Exception {
        // Configure API key authorization: ApiKeyAuth
		Configuration.ApiKeyPrefix.put("Authorization", "YOUR_API_KEY");
		int id = 56; // int? | ID of delivery
		String acceptLanguage = "acceptLanguage_example"; // string | (optional)
		DelivereeApi delivery = new DelivereeApi();
		try {
			ApiResponse<JSONObject> result delivery.cancelBooking(id, acceptLanguage);
		} catch (Exception ex) {
			System.out.print(ex);
		}
	}
}

Getting Add Booking

package test;

import org.json.JSONObject;

import com.google.gson.Gson;

import sdk_java.sdk.api.DelivereeApi;
import sdk_java.sdk.configApi.ApiResponse;
import sdk_java.sdk.configApi.Configuration;
import sdk_java.sdk.model.domain.Delivery;

public class test {
	public static void main(String a[]) throws Exception {
		 // Configure API key authorization: ApiKeyAuth
		Configuration.ApiKeyPrefix.put("Authorization", "YOUR_API_KEY");
		String acceptLanguage = "acceptLanguage_example"; // string | (optional)
		// new delivery in body 
		Delivery body = new Delivery(
                // Add Deliveries body 
                // Locations = new List<Location>{
                    // Add you Location
                  //}
                )
		DelivereeApi delivery = new DelivereeApi();
		try {
			 ApiResponse<JSONObject> result = delivery.createdDelivery(body, acceptLanguage);
//			 ApiResponse<JSONObject> resultAsync = delivery.createdDeliveryAsync(body, acceptLanguage);
		} catch (Exception ex) {
			System.out.print(ex);
		}
	}
}

Get Delivery Detail

package test;

import sdk_java.sdk.api.DelivereeApi;
import sdk_java.sdk.configApi.Configuration;

public class test {
	public static void main(String a[]) throws Exception {
        // Configure API key authorization: ApiKeyAuth
		Configuration.ApiKeyPrefix.put("Authorization", "YOUR_API_KEY");
		int id = 21778; // int? | ID of delivery
		String acceptLanguage = "acceptLanguage_example"; // string | (optional)
		DelivereeApi delivery = new DelivereeApi();
		try {
			ApiResponse<JSONObject> result = delivery.getDetailDelivery(id, acceptLanguage);
			ApiResponse<JSONObject> resultAsync = delivery.getDetailDeliveryAsync(id, acceptLanguage);
		} catch (Exception ex) {
			System.out.print(ex);
		}
	}
}

Get Deliveries List

package test;

import sdk_java.sdk.api.DelivereeApi;
import sdk_java.sdk.configApi.Configuration;
import sdk_java.sdk.configApi.ApiResponse;

public class test {
	public static void main(String a[]) throws Exception {
        // Configure API key authorization: ApiKeyAuth
		Configuration.ApiKeyPrefix.put("Authorization", "YOUR_API_KEY");
		int page = 1; // The page parameter can be used to specify further pages or offsets
		int per_page	= 20; // integer	The per_page can be used for custom page sizes up to 100
		String acceptLanguage = "acceptLanguage_example"; // string | (optional)
		DelivereeApi delivery = new DelivereeApi();
		try {
			ApiResponse<JSONObject> result = getListDelivery(page, per_page, acceptLanguage);
			ApiResponse<JSONObject> resultAsync = getListDeliveryAsync(page, per_page, acceptLanguage);
		} catch (Exception ex) {
			System.out.print(ex);
		}
	}
}

GetQuotes

package test;

import org.json.JSONObject;

import com.google.gson.Gson;

import sdk_java.sdk.api.DelivereeApi;
import sdk_java.sdk.configApi.ApiResponse;
import sdk_java.sdk.configApi.Configuration;
import sdk_java.sdk.model.domain.Quote;

public class test {
	public static void main(String a[]) throws Exception {
		 // Configure API key authorization: ApiKeyAuth
		Configuration.ApiKeyPrefix.put("Authorization", "YOUR_API_KEY");
		String acceptLanguage = "acceptLanguage_example"; // string | (optional)
		// new delivery in body 
		Quote body = new Quote(
                //{
                   // TimeType = "now", // now or schedule
                   // Locations = new List<Location>
                //{
                  //  new Location
                  //  {
                    // location
                 //   }
                //}
        )
		DelivereeApi delivery = new DelivereeApi();
		try {
			 ApiResponse<JSONObject> result = delivery.createdQuote(body, acceptLanguage);
//			 ApiResponse<JSONObject> resultAsync = delivery.createdQuoteAsync(body, acceptLanguage);
		} catch (Exception ex) {
			System.out.print(ex);
		}
	}
}

Get Vehicle Types

package test;

import org.json.JSONObject;

import com.google.gson.Gson;

import sdk_java.sdk.api.DelivereeApi;
import sdk_java.sdk.configApi.ApiResponse;
import sdk_java.sdk.configApi.Configuration;
import sdk_java.sdk.model.domain.Quote;

public class test {
	public static void main(String a[]) throws Exception {
		 // Configure API key authorization: ApiKeyAuth
		Configuration.ApiKeyPrefix.put("Authorization", "YOUR_API_KEY");
		String acceptLanguage = "acceptLanguage_example"; // string | (optional)
		// new delivery in body 
		DelivereeApi delivery = new DelivereeApi();
		try {
			 ApiResponse<JSONObject> result = delivery.getListVehicleTypes(acceptLanguage);
//			 ApiResponse<JSONObject> resultAsync = delivery.getListVehicleTypesAsync(acceptLanguage);
		} catch (Exception ex) {
			System.out.print(ex);
		}
	}
}

Documentation for API Endpoints

All URIs are relative to https://api.sandbox.deliveree.com/public_api/v1

Class Method HTTP request Description
DelivereeApi CancelBooking POST /deliveries/{id}/cancel
DelivereeApi CreatedQuote POST /deliveries/get_quote
DelivereeApi CreatedDelivery POST /deliveries
DelivereeApi GetDetailDelivery GET /deliveries/{id}
DelivereeApi GetListDelivery GET /deliveries
DelivereeApi GetListVehicleTypes GET /vehicle_types

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • acceptLanguage: HTTP header - optional