Filter Values: List Filter Values

Collapse All

URL

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

{format}

xml or json

Method

GET

Required Header Parameters:

  • AuthorizationHashed authorization key
  • AppKeyYour application’s key

Required Query String Parameters:

  • wfsfiltertype Filter whose possible values are desired

Optional Query String Parameters:

  • wfsclassificationid associated classification ID
  • wfsdesignerid associated designer ID
  • wfsfoundryid associated foundry ID
  • wfslanguageid associated language ID

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
  • FilterName name of the filter to use
  • FilterValue: ValueID value ID
  • FilterValue: ValueName Value Name
  • FilterValue: FilterCountCount of available filter options for given filter string.
  • NOTE: if filtertype is Language then ClassificationAssociated, DesignerAssociated, FoundryAssociated (types associated will be returned)

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('classification' => '51431',
		'foundry' => '185289');

var_dump($services->getLibraryFilterChoices('designer', $search));


var_dump($result);
?>     

C#

private string GetListLibraryFilterChoice(string filterType, string classificationId, string designerId, string foundryId, string languageId)
    {

      const string method = "GET";
      string requestUri = "/rest/" + Format + "/FilterValues/" + 
                          "?wfsfiltertype=" + filterType + 
                          "&wfsclassificationid=" + classificationId + 
                          "&wfsdesignerid=" + designerId + 
                          "&wfsfoundryid=" + foundryId + 
                          "&wfslanguageid=" + languageId;

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

    }       

VB.NET

  Private Function GetListLibraryFilterChoice(ByVal filterType As String, ByVal classificationId As String, ByVal designerId As String,
                                              ByVal foundryId As String, ByVal languageId As String) As String

    Const method As String = "GET"
    Dim requestUri As String = "/rest/" & Format & "/FilterValues/" & _
                               "?wfsfiltertype=" & filterType & _
                               "&wfsclassificationid=" & classificationId & _
                               "&wfsdesignerid=" & designerId & _
                               "&wfsfoundryid=" & foundryId & _
                               "&wfslanguageid=" & languageId

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

  End Function

XML Response

<FilterValues>
  <Message>Success</Message>
  <FilterName>language</FilterName>
  <ClassificationAssociated>0</ClassificationAssociated>
  <DesignerAssociated>0</DesignerAssociated>
  <FoundryAssociated>0</FoundryAssociated>
  <FilterValue>
    <ValueID>Arabic</ValueID>
    <ValueName>Arabic</ValueName>
    <FontCount>45</FontCount>
  </FilterValue>
  <FilterValue>
    <ValueID>Armenian</ValueID>
    <ValueName>Armenian</ValueName>
    <FontCount>4</FontCount>
  </FilterValue>
  <FilterValue>
    <ValueID>Cyrillic</ValueID>
    <ValueName>Cyrillic</ValueName>
    <FontCount>239</FontCount>
  </FilterValue>
  <FilterValue>
    <ValueID>Symbol</ValueID>
    <ValueName>Symbol</ValueName>
    <FontCount>96</FontCount>
  </FilterValue>
  <FilterValue>
    <ValueID>Thai</ValueID>
    <ValueName>Thai</ValueName>
    <FontCount>4</FontCount>
  </FilterValue>
</FilterValues>
       

Json Response

{
   "FilterValues":{
      "ClassificationAssociated":"0",
      "DesignerAssociated":"0",
      "FilterName":"language",
      "FilterValue":[
         {
            "FontCount":"45",
            "ValueID":"Arabic",
            "ValueName":"Arabic"
         },
         {
            "FontCount":"4",
            "ValueID":"Armenian",
            "ValueName":"Armenian"
         },
         {
            "FontCount":"239",
            "ValueID":"Cyrillic",
            "ValueName":"Cyrillic"
         },
         {
            "FontCount":"96",
            "ValueID":"Symbol",
            "ValueName":"Symbol"
         },
         {
            "FontCount":"4",
            "ValueID":"Thai",
            "ValueName":"Thai"
         }
      ],
      "FoundryAssociated":"0",
      "Message":"Success"
   }
}