Skip to main content
07399 456 959 admin@uconvert.co.uk

Get All Products Filtered
Last updated: December 07 2018 05:56 PM

Typical Filtered Product Query

We have created what a typical query may look like. We want:

  • Refurbished Apple tablets
  • Sorted by latest release date first.
  • We want a large front jpg image
  • We want some product content to place next to our tablets
  • We want some page content
GET
https://api.uconvert.co.uk/deals/v1/products/?filter[manufacturers]=eq{apple}&filter[productType]=eq{tablets}&filter[condition]=eq{refurbished}&expand=products(page-content,content)&fields=products(front,large,jpg)&sort=products(release-date-asc)
{
  "products": [
    {
      "id": "2053",
      "name": "Apple iPad Pro 10.5 64GB Gold",
      "slug": "apple-ipad-pro-105-64gb-gold",
      "cheapestUpfrontCost": "30.00",
      "cheapestContractPrice": "26.45",
      "condition": "Refurbished",
      "colour": "Gold",
      "hexColour": "#d4ccc1",
      "capacity": "64GB",
      "content": {
        "heading": "Apple iPad Pro 10.5 64GB Gold mobile phone deals",
        "introduction": "Get the very best and latest Apple iPad Pro 10.5 64GB Gold mobile phone deals Compare the best and cheapest Apple iPad Pro 10.5 64GB Gold mobile phone deals from all UK retailers and networks."
      },
      "images": {
        "largeFrontImageJpg": "https://static.uconvert.co.uk/img/products/apple/apple-ipad-pro-105/gold/front_l.jpg"
      }
    }
    {},
    {},
  ],
  "pageContent": [
    {
      "content": {
        "heading": "Refurbished Apple iPad tablet deals",
        "introduction": "We bring you the best Refurbished Apple iPad tablet deals available in the UK today. Compare Refurbished Apple iPad deals from all the major networks and retailers. Choose from a great selection of Refurbsihed Apple iPads, including the latest iPad Pros, iPad Mini and iPad Air."
      },
      "metaData": {
        "title": "Refurbished Apple iPad Tablets | Compare Refurbished Apple iPad tablet Deals",
        "description": "Compare the latest Refurbsihed Apple iPad Tablets. View the latest refurbished ipads and get the best deals",
        "keywords": "Refurbished Apple iPad Tablets, Contract Apple iPad Tablet Deals"
      }
    }
  ]
} 
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.uconvert.co.uk/deals/v1/products/?filter[manufacturers]=eq{apple}&filter[productType]=eq{tablets}&filter[condition]=eq{refurbished}&expand=products(page-content,content)&fields=products(front,large,jpg)&sort=products(release-date-asc)",
  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/?filter[manufacturers]=eq{apple}&filter[productType]=eq{tablets}&filter[condition]=eq{refurbished}&expand=products(page-content,content)&fields=products(front,large,jpg)&sort=products(release-date-asc)' \
--header 'x-api-key: 123456'
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.uconvert.co.uk/deals/v1/products/?filter[manufacturers]=eq{apple}&filter[productType]=eq{tablets}&filter[condition]=eq{refurbished}&expand=products(page-content,content)&fields=products(front,large,jpg)&sort=products(release-date-asc)",
  "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/?filter[manufacturers]=eq{apple}&filter[productType]=eq{tablets}&filter[condition]=eq{refurbished}&expand=products(page-content,content)&fields=products(front,large,jpg)&sort=products(release-date-asc)")

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