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

Product Expand
Last updated: March 09 2019 01:43 PM

Expand Parameter Values Available For Products

The default response does not include related entities. Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response.

Use a comma-separated list to expand by multiple values. E.g, /?expand=products(content,images)

Parameter Type Description and examples
product-content
optional
string Returns an object containing content about the product (heading, introduction)

/?expand=products(content)
page-content
optional
string Returns an object containing page contents (heading, introduction)

/?expand=products(page-content)
product-meta-data
optional
string Returns an object containing meta tags about the HTML document (title, description and keywords)

/?expand=products(meta-data)
product-specs
optional
string Returns an object containing specifications about the product

/?expand=products(specs)
product-images
optional
string Returns an object containing images for the product

/?expand=products(images)
product-deals
optional
string Returns an object containing deals for a INDIVIDUAL product

/?expand=products(deals)
grouped
optional
string Returns an object containing grouped products E.g, instead of returning multiple Apple iPhone 8 Plus products,
only one would be returned

/?expand=products(grouped)

Product Expand Request Example

GET
https://api.uconvert.co.uk/deals/v1/products/?expand=products(content,meta-data)
{
  "products": [
    {
      "id": "1032",
      "name": "Apple iPhone 6 Plus 16GB Gold",
      "slug": "apple-iphone-6-plus-16gb-gold",
      "cheapestUpfrontCost": "20.00",
      "cheapestContractPrice": "26.12",
      "condition": "Refurbished",
      "colour": "Gold",
      "hexColour": "#d4ccc1",
      "capacity": "16GB",
      "content": {
        "heading": "Apple iPhone 6 Plus 16GB Gold mobile phone deals",
        "introduction": "Get the very best and latest Apple iPhone 6 Plus 16GB Gold mobile phone deals Compare the best and cheapest Apple iPhone 6 Plus 16GB Gold mobile phone deals from all UK retailers and networks."
      },
      "metaData": {
        "title": "Apple iPhone 6 Plus 16GB Gold Contract Mobile Phone Deals",
        "description": "Compare the best Apple iPhone 6 Plus 16GB Gold contract mobile phone deals. Buy the Apple iPhone 6 Plus 16GB Gold from all the top networks and leading retailers.",
        "keywords": "Apple iPhone 6 Plus 16GB Gold contract mobile phone deals, specifications, product overview, compare mobile phone deals"
      }
    },
    {
      "id": "1035",
      "name": "Apple iPhone 6 Plus 16GB Space Grey",
      "slug": "apple-iphone-6-plus-16gb-space-grey",
      "cheapestUpfrontCost": "20.00",
      "cheapestContractPrice": "26.12",
      "condition": "Refurbished",
      "colour": "Space Grey",
      "hexColour": "#656668",
      "capacity": "16GB",
      "content": {
        "heading": "Apple iPhone 6 Plus 16GB Space Grey mobile phone deals",
        "introduction": "Get the very best and latest Apple iPhone 6 Plus 16GB Space Grey mobile phone deals Compare the best and cheapest Apple iPhone 6 Plus 16GB Space Grey mobile phone deals from all UK retailers and networks."
      },
      "metaData": {
        "title": "Apple iPhone 6 Plus 16GB Space Grey Contract Mobile Phone Deals",
        "description": "Compare the best Apple iPhone 6 Plus 16GB Space Grey contract mobile phone deals. Buy the Apple iPhone 6 Plus 16GB Space Grey from all the top networks and leading retailers.",
        "keywords": "Apple iPhone 6 Plus 16GB Space Grey contract mobile phone deals, specifications, product overview, compare mobile phone deals"
      }
    }
  ]
} 
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.uconvert.co.uk/deals/v1/products/?expand=products(content,meta-data)",
  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(content,meta-data)' \
--header 'x-api-key: 123456'
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.uconvert.co.uk/deals/v1/products/?expand=products(content,meta-data)",
  "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(content,meta-data)")

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