Filters: List Filters

Collapse All

URL

http://api.fonts.com/rest/{format}/Filters/

{format}

xml or json

Method

GET

Required Header Parameters:

  • AuthorizationHashed authorization key
  • AppKeyYour application’s key

Required Query String Parameters:

  • None

Optional Query String Parameters:

  • None

Response variables:

  • MessageIf the response is successful then the “message” parameter of the response will be “Success” and if there is some error or failure then the “message” parameter will be the error message.
  • Filter: FilterStringfilter by which the font library may be filtered
  • Filter: FilterCountCount of available filter options for given filter string.

Sample Code

PHP

  <?php

require_once('Services_WFS.php');

$services = new Services_WFS;

$apiKey = '[Your API Key]';
$publicKey = '[Your Public Key]';
$privateKey = '[Your Private Key]';
$services->setCredentials($publicKey, $privateKey, $apiKey);

var_dump($services->getLibraryFilters());

?>

C#

 private string GetListLibraryFilters()
    {

      const string method = "GET";
      string requestUri = "/rest/" + Format+ "/Filters/";

      //See common functions for GetResponse
      return GetResponse(method, requestUri);

    }       

VB.NET

Private Function GetListLibraryFilters() As String

    Const method As String = "GET"
    Dim requestUri As String = "/rest/" & Format & "/Filters/"

    'See common functions for GetResponse
    Return GetResponse(method, requestUri)

  End Function       

XML Response

<Filters>
  <Message>Success</Message>
  <Filter>
    <FilterString>Classification</FilterString>
    <FilterCount>12</FilterCount>
  </Filter>
  <Filter>
    <FilterString>Designer</FilterString>
    <FilterCount>632</FilterCount>
  </Filter>
  <Filter>
    <FilterString>Foundry</FilterString>
    <FilterCount>17</FilterCount>
  </Filter>
  <Filter>
    <FilterString>Language Support</FilterString>
    <FilterCount>13</FilterCount>
  </Filter>
  <Filter>
    <FilterString>Initial Letter</FilterString>
    <FilterCount>37</FilterCount>
  </Filter>
  <Filter>
    <FilterString>Free Vs Paid</FilterString>
    <FilterCount>2</FilterCount>
  </Filter>
</Filters>       

Json Response

{
   "Filters":{
      "Filter":[
         {
            "FilterCount":"12",
            "FilterString":"Classification"
         },
         {
            "FilterCount":"632",
            "FilterString":"Designer"
         },
         {
            "FilterCount":"17",
            "FilterString":"Foundry"
         },
         {
            "FilterCount":"13",
            "FilterString":"Language Support"
         },
         {
            "FilterCount":"37",
            "FilterString":"Initial Letter"
         },
         {
            "FilterCount":"2",
            "FilterString":"Free Vs Paid"
         }
      ],
      "Message":"Success"
   }
}