Filter Values: List All Filter Values

Collapse All

URL

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

{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:

  • wfsclassificationidassociated classification ID
  • wfsdesigneridassociated designer ID
  • wfsfoundryidassociated foundry ID
  • wfslanguageidassociated language ID
  • wfsalphacharassociated alpha characters
  • wfsfreeorpaidassociated font tier options (0: Free, -1: All)

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.
  • ClassificationAssociated associated classification ID
  • DesignerAssociated associated designer ID
  • FoundryAssociated associated foundry ID
  • LanguageAssociated associated language ID
  • StartCharacterAssociatedassociated alpha characters
  • FreeOrPaid associated font tier (0: Free, -1: All)
  • FilterValue: ValueID value ID
  • FilterValue: ValueName Value Name
  • FilterValue: FilterCountCount of available filter options for given filter string.
  • FilterValue: FilterTypefilter type of this filter value (classification, designer, foundry, language, alpha, freeorpaid)

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);

$search = array('language' => 'Arabic',
		'letter' => 'Z');

$result = $services->getAllLibraryFilterChoices($search);

var_dump($result);
?>      

C#

  private static string ListAllFilters(string classificationId, string designerId, string founryId, string languageId, string alphachar, string freeorpaid)
    {

      const string method = "GET";
      string requestUri = "/rest/" + Format + "/AllFilterValues/" +
                          "?&wfsclassificationid=" + classificationId +
                          "&wfsdesignerid=" + designerId +
                          "&wfsfoundryid=" + founryId +
                          "&wfslanguageid=" + languageId +
                          "&wfsalphachar=" + alphachar +
                          "&wfsfreeorpaid=" + freeorpaid;

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

    }       

VB.NET

 Private Function ListAllFilters(ByVal classificationId As String, ByVal designerId As String, 
                                  ByVal founryId As String, ByVal languageId As String, 
                                  ByVal alphachar As String, ByVal freeorpaid As String) As String

    Const method As String = "GET"
    Dim requestUri As String = "/rest/" & Format & "/AllFilterValues/" & _
                               "?&wfsclassificationid=" & classificationId & _
                                "&wfsdesignerid=" & designerId & _
                                "&wfsfoundryid=" & founryId & _
                                "&wfslanguageid=" & languageId & _
                                "&wfsalphachar=" & alphachar & _
                                "&wfsfreeorpaid=" & freeorpaid

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

  End Function       

XML Response

<FilterValues>
  <Message>Success</Message>
  <ClassificationAssociated>0</ClassificationAssociated>
  <DesignerAssociated>0</DesignerAssociated>
  <FoundryAssociated>0</FoundryAssociated>
  <LanguageAssociated>W26</LanguageAssociated>
  <StartCharacterAssociated>A</StartCharacterAssociated>
  <FreeOrPaid>0</FreeOrPaid>
  <FilterValue>
    <ValueID>Symbol</ValueID>
    <ValueName>Symbol</ValueName>
    <FontCount>1</FontCount>
    <FilterType>Language</FilterType>
  </FilterValue>
  <FilterValue>
    <ValueID>Latin</ValueID>
    <ValueName>Latin</ValueName>
    <FontCount>177</FontCount>
    <FilterType>Language</FilterType>
  </FilterValue>
  <FilterValue>
    <ValueID>Arabic</ValueID>
    <ValueName>Arabic</ValueName>
    <FontCount>1</FontCount>
    <FilterType>Language</FilterType>
  </FilterValue>
  <FilterValue>
    <ValueID>H</ValueID>
    <ValueName>H</ValueName>
    <FontCount>4</FontCount>
    <FilterType>Alpha</FilterType>
  </FilterValue>
  <FilterValue>
    <ValueID>-1</ValueID>
    <ValueName>All</ValueName>
    <FontCount>172</FontCount>
    <FilterType>FreeOrPaid</FilterType>
  </FilterValue>
</FilterValues>       

Json Response

{
   "FilterValues":{
      "ClassificationAssociated":"0",
      "DesignerAssociated":"0",
      "FilterValue":[
         {
            "FilterType":"Language",
            "FontCount":"1",
            "ValueID":"Symbol",
            "ValueName":"Symbol"
         },
         {
            "FilterType":"Language",
            "FontCount":"177",
            "ValueID":"Latin",
            "ValueName":"Latin"
         },
         {
            "FilterType":"Language",
            "FontCount":"1",
            "ValueID":"Arabic",
            "ValueName":"Arabic"
         },
         {
            "FilterType":"Alpha",
            "FontCount":"4",
            "ValueID":"H",
            "ValueName":"H"
         },
         {
            "FilterType":"FreeOrPaid",
            "FontCount":"172",
            "ValueID":"-1",
            "ValueName":"All"
         }
      ],
      "FoundryAssociated":"0",
      "FreeOrPaid":"0",
      "LanguageAssociated":"W26",
      "Message":"Success",
      "StartCharacterAssociated":"A"
   }
}