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

Product Filtering
Last updated: December 07 2018 05:56 PM

Filter Parameter Values Available For Products

Use a comma-separated list to filter by multiple values. E.g, /?filter[colours]={red,blue} or /?filter[manufacturers]=eq{apple,nokia}

Parameter Type Operators Values Description
manufacturers
optional
string eq Use the following endpoint to return all the available manufacturers. https://api.uconvert.co.uk/deals/v1/manufacturers/.

Alternatively use the 'List all manufacturers' query in the 'Getting Started' folder in our postman collection.
Returns products for particular manufacturer(s). You can use either the slug or manufacturer id.



/?filter[manufacturers]=eq{apple}
/?filter[manufacturers]=eq{apple,nokia}
/?filter[manufacturers]=eq{4}
/?filter[manufacturers]=eq{4,12,17}

/?filter[manufacturers]=eq{4,huawei,17} MIXING NAMES AND IDs WIll NOT WORK
condition
optional
string eq new or refurbished Returns refurbished or new products

/?filter[condition]=eq{new}
/?filter[condition]=eq{refurbished}
productType
optional
string eq phones or tablets or watches or mbb Returns phones, tablets, watches or mobile broadband

/?filter[productType]=eq{phones}
/?filter[productType]=eq{tablets}
/?filter[productType]=eq{watches}
/?filter[productType]=eq{mbb}
os
optional
string eq Use the following endpoint to return all the available opersting systems (os). https://api.uconvert.co.uk/deals/v1/os/.

Alternatively use the 'List all operating system' query in the 'Getting Started' folder in our postman collection.
Returns products for a particular operating system (os).



/?filter[os]=eq{Android OS}
colours
optional
string eq Use the following endpoint to return all the available colours. https://api.uconvert.co.uk/deals/v1/colours/.

Alternatively use the 'List all colours' query in the 'Getting Started' folder in our postman collection.
Returns products for a particular colour.

/?filter[colour]=eq{red}
capacity
optional
string eq 32 or 64 or 128 or 256 or 512 Returns products for a particular capacity (internal memory).

/?filter[capacity]=eq{32}
/?filter[capacity]=eq{64}
/?filter[capacity]=eq{128}
/?filter[capacity]=eq{256}
/?filter[capacity]=eq{512}

Product Filter Example

Filter products

GET
https://api.uconvert.co.uk/deals/v1/products/?filter[manufacturers]=eq{nokia}&filter[productType]=eq{phones}&filter[condition]=eq{new}
{
  "products": [
    {
      "id": "1159",
      "name": "Nokia 130 Black",
      "slug": "nokia-130-black",
      "cheapestUpfrontCost": "0.00",
      "cheapestContractPrice": "15.00",
      "condition": "New",
      "colour": "Black",
      "hexColour": "#000000",
      "capacity": "0GB"
    },
    {
      "id": "1398",
      "name": "Nokia 130 Red",
      "slug": "nokia-130-red",
      "cheapestUpfrontCost": "0.00",
      "cheapestContractPrice": "15.00",
      "condition": "New",
      "colour": "Red",
      "hexColour": "#FF00000",
      "capacity": "0GB"
    }
  ]
} 
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.uconvert.co.uk/deals/v1/products/?filter[manufacturers]=eq{nokia}&filter[productType]=eq{phones}&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/?filter[manufacturers]=eq{nokia}&filter[productType]=eq{phones}&filter[condition]=eq{new}' \
--header 'x-api-key: 123456'
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.uconvert.co.uk/deals/v1/products/?filter[manufacturers]=eq{nokia}&filter[productType]=eq{phones}&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/?filter[manufacturers]=eq{nokia}&filter[productType]=eq{phones}&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