Open API - Shipping Carrier Codes

API Endpoint:

URL: https://api.routeit.cloud/konnektive/v2/get/json/shipping_carrier_codes
Protocal: HTTPS
Method: GET
Authentication: API Key and Secret via header
Content Type: application/json

All API calls must include this header to authorize the request.
Replace YOUR-KEY-HERE with your API key and YOUR-SECRET-HERE with your secret.

Header Key Header Value
api_key YOUR-KEY-HERE
secret YOUR-SECRET-HERE
Content-Type application/json

Body:

This request is strictly informational. No body is required for this API request.

Code Examples:

The following are examples for reference and may require library dependencies not described here. An understanding of REST services, JSON, and web security is required to develop service clients.

Javascript - Jquery AJAX
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes",
  "method": "GET",
  "headers": {
    "api_key": "YOUR-KEY-HERE",
    "secret": "YOUR-SECRET-HERE",
    "content-type": "application/json",
    "cache-control": "no-cache"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
                            
Javascript - XHR
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes");
xhr.setRequestHeader("api_key", "YOUR-KEY-HERE");
xhr.setRequestHeader("secret", "YOUR-SECRET-HERE");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);
                            
Node JS - Native
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "api.routeit.cloud",
  "port": null,
  "path": "/open_api/v1/get/json/shipping_carrier_codes",
  "headers": {
    "api_key": "YOUR-KEY-HERE",
    "secret": "YOUR-SECRET-HERE",
    "content-type": "application/json",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
                            
Node JS - Request
var request = require("request");

var options = { method: 'GET',
  url: 'http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes',
  headers:
   { 'cache-control': 'no-cache',
     'content-type': 'application/json',
     secret: 'YOUR-SECRET-HERE',
     api_key: 'YOUR-KEY-HERE' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
                            
Node JS - Unirest
var unirest = require("unirest");

var req = unirest("GET", "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes");

req.headers({
  "cache-control": "no-cache",
  "content-type": "application/json",
  "secret": "YOUR-SECRET-HERE",
  "api_key": "YOUR-KEY-HERE"
});


req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
                            
Java - OK HTTP
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes")
  .get()
  .addHeader("api_key", "YOUR-KEY-HERE")
  .addHeader("secret", "YOUR-SECRET-HERE")
  .addHeader("content-type", "application/json")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
                            
Java - Unirest
HttpResponse<String> response = Unirest.get("http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes")
  .header("api_key", "YOUR-KEY-HERE")
  .header("secret", "YOUR-SECRET-HERE")
  .header("content-type", "application/json")
  .header("cache-control", "no-cache")
  .asString();
                            
C# (ReSharp)
var client = new RestClient("http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/json");
request.AddHeader("secret", "YOUR-SECRET-HERE");
request.AddHeader("api_key", "YOUR-KEY-HERE");
IRestResponse response = client.Execute(request);
                            
Go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api_key", "YOUR-KEY-HERE")
	req.Header.Add("secret", "YOUR-SECRET-HERE")
	req.Header.Add("content-type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
                            
Python - http.client (Python 3)
import http.client

conn = http.client.HTTPConnection("api.routeit.cloud")

headers = {
    'api_key': "YOUR-KEY-HERE",
    'secret': "YOUR-SECRET-HERE",
    'content-type': "application/json",
    'cache-control': "no-cache"
    }

conn.request("GET", "/open_api/v1/get/json/shipping_carrier_codes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
                            
Python - Requests
import requests

url = "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes"

headers = {
    'api_key': "YOUR-KEY-HERE",
    'secret': "YOUR-SECRET-HERE",
    'content-type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
                            
Ruby (NET::Http)
require 'uri'
require 'net/http'

url = URI("http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["api_key"] = 'YOUR-KEY-HERE'
request["secret"] = 'YOUR-SECRET-HERE'
request["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
                            
PHP - HttpRequest
<?php

$request = new HttpRequest();
$request->setUrl('http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'secret' => 'YOUR-SECRET-HERE',
  'api_key' => 'YOUR-KEY-HERE'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
                            
PHP - peci_http
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'secret' => 'YOUR-SECRET-HERE',
  'api_key' => 'YOUR-KEY-HERE'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
                            
PHP - cURL
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "api_key: YOUR-KEY-HERE",
    "cache-control: no-cache",
    "content-type: application/json",
    "secret: YOUR-SECRET-HERE"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
                            
HTTP
GET /open_api/v1/get/json/shipping_carrier_codes HTTP/1.1
Host: api.routeit.cloud
api_key: YOUR-KEY-HERE
secret: YOUR-SECRET-HERE
Content-Type: application/json
Cache-Control: no-cache
                            
Shell - wget
wget --quiet \\
  --method GET \\
  --header 'api_key: YOUR-KEY-HERE' \\
  --header 'secret: YOUR-SECRET-HERE' \
  --header 'content-type: application/json' \\
  --header 'cache-control: no-cache' \\
  --output-document \\
  - http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes
                            
Shell - Httpie
http GET http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes \\
  api_key:YOUR-KEY-HERE \\
  cache-control:no-cache \\
  content-type:application/json \\
  secret:YOUR-SECRET-HERE
                            
Shell - cURL
curl --request GET \\
  --url http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes \\
  --header 'api_key: YOUR-KEY-HERE' \\
  --header 'cache-control: no-cache' \\
  --header 'content-type: application/json' \\
  --header 'secret: YOUR-SECRET-HERE'
                            
cURL
curl -X GET -H "api_key: YOUR-KEY-HERE" -H "secret: YOUR-SECRET-HERE" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes"
                            
C (LibCurl)
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "secret: YOUR-SECRET-HERE");
headers = curl_slist_append(headers, "api_key: YOUR-KEY-HERE");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
                            
Objective-C (NSURL)
#import <Foundation/Foundation.h>

NSDictionary *headers = @{ @"api_key": @"YOUR-KEY-HERE",
                           @"secret": @"YOUR-SECRET-HERE",
                           @"content-type": @"application/json",
                           @"cache-control": @"no-cache";

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
                            
Swift (NSURL)
import Foundation

let headers = [
  "api_key": "YOUR-KEY-HERE",
  "secret": "YOUR-SECRET-HERE",
  "content-type": "application/json",
  "cache-control": "no-cache"
]

var request = NSMutableURLRequest(URL: NSURL(string: "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    println(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    println(httpResponse)
  }
})

dataTask.resume()
                            
OCaml (Cohttp)
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "http://api.routeit.cloud/open_api/v1/get/json/shipping_carrier_codes" in
let headers = Header.init ()
  |> fun h -> Header.add h "api_key" "YOUR-KEY-HERE"
  |> fun h -> Header.add h "secret" "YOUR-SECRET-HERE"
  |> fun h -> Header.add h "content-type" "application/json"
  |> fun h -> Header.add h "cache-control" "no-cache"
in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
                            

Response:

The response returns JSON and consists of the result, error_messages, and data.
{
  "result": "SUCCESS",
  "error_messages": null,
  "data": {
    "directlink": "Direct Link",
    "ajexpress": "a j express",
    "dpd-poland": "DPD Poland",
    ...
  }
}
                    
Response Body Key Response Body Value Description
result SUCCESS or ERROR Only returns SUCCESS or ERROR.
error_messages null or error messages Returns null if result is SUCCESS or a string[] of errors if result is ERROR.
data data envelope or null Returns data envelope with valid shipping carrier codes and descriptions if result is SUCCESS or null if result is ERROR.

Errors:

This API can return the following errors as strings:
This API requires request method GET.
All API calls must include a valid api_key and secret in the header to authenticate.
Invalid api_key or secret.
No billing setup for these keys. Live API requests require valid billing. If this is a test, use the Test API keys.