{
"products" : [
{
"id": "1032",
"name": "Apple iPhone 6 Plus 16GB Gold",
"slug": "apple-iphone-6-plus-16gb-gold",
"cheapestDeal": {
"upfrontProductCost": "0.00",
"monthlyContractPrice": "31.00",
"currenyLabel": "£",
"monthlyTextAllowance": "999999",
"monthlyFriendlyTextAllowance": "Unlimited",
"monthlyTextAllowanceLabel": "texts",
"monthlyCallAllowance": "999999",
"monthlyFriendlyCallAllowance": "Unlimited",
"monthlyCallAllowanceLabel": "minutes",
"monthlyDataAllowance": "20000",
"monthlyFriendlyDataAllowance": 20,
"monthlyDataAllowanceLabel": "GB",
"contractLength": "24",
"contractLengthLabel": "months",
"contractSupplierId": "3",
"contractSupplierName": "EE",
"contractSupplierLogo": "https://static.uconvert.co.uk/img/badges/network-3.png",
"retailSupplierId": "7",
"retailSupplierName": "Affordable Mobiles",
"retailSupplierLogo": "https://static.uconvert.co.uk/img/badges/retailer-7.png",
"totalContractCost": "744.00",
"purchaseLink": "https://deals.uconvert.co.uk/deal_redirect/3/504993687/"
},
},
]
}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uconvert.co.uk/deals/v1/products/?expand=products(cheapestDeal)",
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(
"x-api-key: 123456"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl --request GET \
--url 'https://api.uconvert.co.uk/deals/v1/products/?expand=products(cheapestDeal)' \
--header 'x-api-key: 123456'
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.uconvert.co.uk/deals/v1/products/?expand=products(cheapestDeal)",
"method": "GET",
"headers": {
"x-api-key": "123456"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://api.uconvert.co.uk/deals/v1/products/?expand=products(cheapestDeal)")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '123456'
response = http.request(request)
puts response.read_body