{
"products" : [
{
"id": "2203",
"name": "Apple iPhone 8 256GB Silver",
"slug": "apple-iphone-8-256gb-silver",
}
],
"deals": [
{
"contractName": "Virgin Mobile Pay Monthly Plan",
"contractLength": "24",
"contractSupplierId": "12",
"contractSupplierName": "Virgin Mobile",
"friendlyContractLength": "24 Month Contract",
"dataAllowance": "1000",
"friendlyDataAllowance": "1GB",
"callAllowance": "1000",
"friendlyCallAllowance": "1000 mins",
"textAllowance": "999999",
"friendlyTextAllowance": "Unlimited",
"dealLink": "https://deals.uconvert.co.uk/deal_redirect/5/209496741/",
"totalDealCost": "1188.00",
"supplierId": "12",
"supplierName": "Virgin Mobile",
"productUpfrontCost": "0.00",
"supplierContractPrice": "60.00",
"productImg": "https://static.uconvert.co.uk/img/ . . .",
"productName": "Apple iPhone 8 256GB Silver"
}
{},
{},
{},
]
}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uconvert.co.uk/deals/v1/products/2203/?expand=products(deals)&filter[condition]=eq{new}",
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/2203/?expand=products(deals)&filter[condition]=eq{new}' \
--header 'x-api-key: 123456'
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.uconvert.co.uk/deals/v1/products/2203/?expand=products(deals)&filter[condition]=eq{new}",
"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/2203/?expand=products(deals)&filter[condition]=eq{new}")
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