Print Shipment Label V - 3.0.0
Lets you print the Shipment Label of package with iThink Logistics.
Staging URL
Production URL
Parameter
Field | Type | Description |
---|---|---|
access_token | String | You will get this from IThink Logistics team. |
secret_key | String | You will get this from IThink Logistics team. |
awb_numbers | Integer | AWB Number which you want to print (Comma Separated & Max 100 AWB Number at a time). |
page_size | Integer | Shipment Label Page Size(eg. A4, A5, A6). |
display_cod_prepaid | Integer | Allow display of COD/PREPAID value. |
display_shipper_mobile | Integer | Allow display of shipper address. |
display_shipper_address | Integer | Allow display of shipper address. |
{ "data": { "awb_numbers" : "86210010463", #AWB Number whose data is needed. "page_size" : "A4", "access_token" : "eb24e17b9d88443e26bc822419b90ddf", "secret_key" : "bed1a92798551638eeb0f2ceb1845d3d", "display_cod_prepaid" : "", #1- yes, 0- No, blank - Default as per settings. #NEW "display_shipper_mobile" : "", #1- yes, 0- No, blank - Default as per settings. #NEW "display_shipper_address" : "" #1- yes, 0- No, blank - Default as per settings. #NEW } }
{ "status": "success", "status_code": 200, "file_name": "http://pre-alpha.ithinklogistics.com/uploads/shipping/b04f3619fc54612329b089c073a7d812.pdf" }
Sample Beta Code
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://pre-alpha.ithinklogistics.com/api_v3/shipping/label.json", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\"data\":{\"access_token\":\"eb24e17b9d88443e26bc822419b90ddf\",\"secret_key\":\"bed1a92798551638eeb0f2ceb1845d3d\",\"awb_numbers\":\"86210010463\",\"page_size\":\"A4\",\"display_cod_prepaid\":\"\",\"display_shipper_mobile\":\"\",\"display_shipper_address\":\"\"}}\n", CURLOPT_HTTPHEADER => array( "cache-control: no-cache", "content-type: application/json" ) )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
import requests url = "https://pre-alpha.ithinklogistics.com/api_v3/shipping/label.json" payload = "{\"data\":{\"access_token\":\"eb24e17b9d88443e26bc822419b90ddf\",\"secret_key\":\"bed1a92798551638eeb0f2ceb1845d3d\",\"awb_numbers\":\"86210010463\",\"page_size\":\"A4\",\"display_cod_prepaid\":\"\",\"display_shipper_mobile\":\"\",\"display_shipper_address\":\"\"}}\n" headers = { 'content-type': "application/json", 'cache-control': "no-cache" } response = requests.request("POST", url, data=payload, headers=headers) print(response.text)
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"access_token\":\"eb24e17b9d88443e26bc822419b90ddf\",\"secret_key\":\"bed1a92798551638eeb0f2ceb1845d3d\",\"awb_numbers\":\"86210010463\",\"page_size\":\"A4\",\"display_cod_prepaid\":\"\",\"display_shipper_mobile\":\"\",\"display_shipper_address\":\"\"}}\n"); Request request = new Request.Builder() .url("https://pre-alpha.ithinklogistics.com/api_v3/shipping/label.json") .post(body) .addHeader("content-type", "application/json") .addHeader("cache-control", "no-cache") .build(); Response response = client.newCall(request).execute();
var client = new RestClient("https://pre-alpha.ithinklogistics.com/api_v3/shipping/label.json"); var request = new RestRequest(Method.POST); request.AddHeader("cache-control", "no-cache"); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"data\":{\"access_token\":\"eb24e17b9d88443e26bc822419b90ddf\",\"secret_key\":\"bed1a92798551638eeb0f2ceb1845d3d\",\"awb_numbers\":\"86210010463\",\"page_size\":\"A4\",\"display_cod_prepaid\":\"\",\"display_shipper_mobile\":\"\",\"display_shipper_address\":\"\"}}\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
require 'uri' require 'net/http' url = URI("https://pre-alpha.ithinklogistics.com/api_v3/shipping/label.json") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(url) request["content-type"] = 'application/json' request["cache-control"] = 'no-cache' request.body = "{\"data\":{\"access_token\":\"eb24e17b9d88443e26bc822419b90ddf\",\"secret_key\":\"bed1a92798551638eeb0f2ceb1845d3d\",\"awb_numbers\":\"86210010463\",\"page_size\":\"A4\",\"display_cod_prepaid\":\"\",\"display_shipper_mobile\":\"\",\"display_shipper_address\":\"\"}}\n" response = http.request(request) puts response.read_body