Skip to main content
07399 456 959 [email protected]

Gift Categories Images Object - Partial Request
Last updated: January 05 2022 11:19 PM

Fields Parameter Values Available For Gift Categories Images Object

A way to improve the performance of your API request is by requesting a partial response receiving only the data that your application is interested in. This allows your application to perform more efficiently. By default, the server sends back the full representation of a resource you requested. For improved performance, you can request only the fields you need. To request a partial response, use the fields query parameter and specify the fields you want returned.

If you want to return the url for a single or multiple images use the images query parameter. The parameter must contain at least one view (front), one size (large) and one format (webp,png,jpg). Use a comma-separated within the brackets to select your image.

E.g. /?fields=giftcategories(front,large,png) or /?fields=giftcategories(front,large,jpg)

The fields query parameter is used to retrieve single or multiple images in the response for the gift categories images object. A list of fields query parameter values for gift categories images object are shown below.

Parameter Type Values Description and examples
fields
optional
string large,
front,
png, jpg, webp
Returns single or multiple images

/?fields=giftcategories(front,large,png)
/?fields=giftcategories(front,large,jpg,png)

Gift Categories Images Object Partial Request Example

GET
https://api.uconvert.co.uk/deals/v1/gifts/categories/?fields=giftcategories(front,large,png)
{
  "giftCategories" : [
    {
      "id": "2",
      "name": "Games Consoles Deals",
      "slug": "games-consoles-deals",
      "images": {
        "largeFrontImagePng": "http://static.local.co.uk/img/gifts/default/games-consoles-deals.png"
      }
    },
    {
      "id": "4",
      "name": "Laptops Deals",
      "slug": "laptops-deals",
      "images": {
        "largeFrontImagePng": "http://static.local.co.uk/img/gifts/default/laptops-deals.png"
      }
    }
  ]
}
$curl = curl_init();

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

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