Skip to main content
07399 456 959 [email protected]

Product Attributes Object
Last updated: January 05 2022 11:19 PM

We supply a default set of attributes for each product in the product attributes object.

Product Attributes Object

Attribute Type Description
attributes array[object] An array containing attributes for the product.
attributes.colour string A colour for the product

E.g. Gold
attributes.hex_colour string A hex colour for the product

E.g. #d4ccc1
attributes.capacity integer A capacity for the product

E.g. 256
attributes.capacityLabel string A capacity label for the product

E.g. GB
attributes.condition string The condition of the product

E.g. New

Product Expand Attributes Request Example

GET
https://api.uconvert.co.uk/deals/v1/products/?expand=products(attributes)
{
  "products" : [
    {
      "id": "1032",
      "name": "Apple iPhone 6 Plus 16GB Gold",
      "slug": "apple-iphone-6-plus-16gb-gold",      
      "attributes": {
        "condition": "New",
        "colour": "Gold",
        "hexColour": "#d4ccc1",
        "capacity": "16",
        "capacityLabel": "GB",
      }
    },
  ]
}
$curl = curl_init();

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

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