Skip to main content
07399 456 959 [email protected]

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

Fields Parameter Values Available For Gift Categories Meta Data 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.

The fields query parameter is used to retrieve single or multiple fields in the response for a gift category or gift categories. A full list of fields query parameters for the gift categories meta data object are shown below.

Use a comma-separated list to return multiple attributes. E.g, /?fields=giftcategories(meta-data-title)

Attribute Type Value Description and example
fields
optional
string meta-data-title A page title for the html document

/?fields=giftcategories(meta-data-title)
fields
optional
string meta-data-description A page description for the html document

/?fields=giftcategories(meta-data-description)
fields
optional
string meta-data-keywords Page keywords for the html document

/?fields=giftcategories(meta-data-keywords)

Gift Categories Meta Data Object Partial Request

GET
https://api.uconvert.co.uk/deals/v1/gifts/categories/?fields=giftcategories(meta-data-title)
{
  "giftCategories" : [
    {
      "id": "2",
      "name": "Games Consoles Deals",
      "slug": "games-consoles-deals",
      "metaData": {
        "title": "Free Games Console with Phone Contracts - Compare FREE gift mobile phone deals",
      }
    },
    {
      "id": "4",
      "name": "Laptops Deals",
      "slug": "laptops-deals",
      "metaData": {
        "title": "Free laptop with mobile phone contracts",      
      }
    },
    {},
    {},
    {}
  ]
}
$curl = curl_init();

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

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