![]() |
Add The Best Courier Services to Your Website
Pre-filling calculator values You can also pre-fill some values adding a query string to the calculator URL. You must start the query with a question mark(?) and then enter some parameters. Use equal sign (=) to assign values and ampersand (&) to delimit the parameters. The following table summarizes the list of parameters accepted by the E-Go calculator.
Example
Then create a link to our calculator adding a query which contains all parameters. The following is a link to our calculator for the example above. <a href="http://www.e-go.com.au/calculator.do?pickup=2000&width=40&height=35&depth=65&weight=2&type=Carton" target="_blank">E-Go Calculator</a> Finally, add the link to your website and test it to ensure it works as expected. To pre-fill the calculator with multiple goods, you can specify an array of values for type, weight, items, width, height and depth. The following is an example for multiple goods. <a href="http://www.e-go.com.au/calculator.do?pickup=2000&type[0]=Carton&width[0]=40&height[0]=35&depth[0]=65& eBay
If you are an eBay seller and want to add the E-Go Calculator to your eBay page, you can create a link as described above and add it to the 'Item Description' section. API
If you have a merchant website and want to offer on-line quote of delivery charges to your customers, you can use our Calculator API. Our API can be accessed by any programming language that can perform HTTP requests such as PHP, Cold Fusion, Java and many others. INPUT: The input consists of a URL pointing to our Calculator API. An example is: http://www.e-go.com.au/calculatorAPI?pickup=2000&delivery=4000&type=Carton&width=40&height=35&depth=65&weight=2&items=3 If you want a quote for multiple goods, you can specify an array of values for the fields: type, weight, items, width, height and depth. The following is an example for multiple goods. http://www.e-go.com.au/calculatorAPI?pickup=2000&delivery=4000&type[0]=Carton&width[0]=40&height[0]=35&depth[0]=65& If you require depot pricing, you must ensure the postcode(s) issued are valid depot postcodes and you must include the variable bookingtype. For example: http://www.e-go.com.au/calculatorAPI?pickup=2163&delivery=4008&type=Carton&width=40&height=35&depth=65&weight=2&items=3&bookingtype=depot2depot The valid values for bookingtype are: depot2depot, depot2door and door2depot If you do not require depot pricing, then do not include the variable bookingtype in your API call. In order to prevent the URL from becoming too long, the array of fields can also be specified using HTTP POST requests. The following table summarizes the data you must pass to our API in order to get a quote.
OUTPUT: The API will output the fields below:
Note that in the output, fields will be line-separated (character '\n') and each line will contain a field name and respective value separated by '='. See example below. error=OK eta=Overnight price=14.52 The following piece of code is a simple example of how to access our Calculator API using PHP. <? $calculator_url = "http://www.e-go.com.au/calculatorAPI"; /* from/to postcodes */ $pickup = 2000; //From Sydney $delivery = 4000; //From Brisbane /* Dimensions */ $width = 40; $height = 35; $depth = 65; $weight = 2; $ego_params = "?pickup=$pickup&delivery=$delivery"; $ego_params .= "&width=$width"; $ego_params .= "&height=$height&depth=$depth&weight=$weight"; $ego_quote = file($calculator_url . $ego_params); foreach ($ego_quote as $num=>$quote) { $quote = trim($quote); $quote_field = explode("=", $quote); print "Field=" . $quote_field[0] . "\tValue=" . $quote_field[1] . "\n"; } ?> |
||||||||||||||||||||||||||||||||||||||||||
Courier Services Australia | ||||||||||||||||||||||||||||||||||||||||||
Courier | Freight | Interstate Courier | Cheap Courier | Courier Services | Freight Services |