Fonts: Delete Font

Collapse All

URL

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

{format}

xml or json

Method

DELETE

Required Header Parameters

  • authorizationHashed authorization key
  • appkeyYour application’s key

Required Query String Parameters

  • wfspidThe project id
  • wfsfidThe font id ( font to be deleted )

Optional Query String Parameters

  • wfsnopublishThis command automatically calls Publish once it is complete, which takes multiple seconds. To prevent this, use this parameter, set it to 1, and use Publish after all changes are made.
  • wfspstartstarting record requested (zero-based)
  • wfsplimit# of records requested

Response variables

  • ProjectIDProject ID number
  • 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.
  • Font: FontIDIdentifier of the font. Every font in the Fonts.com Web Fonts service has a unique FontID.
  • Font: FontNameDisplay name of the font.
  • Font: FontPreviewTextLongThe long text string used to show the appearance of the font.
  • Font: FontFoundryNameThe name of font designer or company.
  • Font: FontCSSNameThe font-family name of the font.
  • Font: FontLanguageThe language supported by the font.
  • Font: FontSizeThe size of the font file.
  • Font: CDNKeyThe authentication key for fetching the font file from the content distribution network (CDN).
  • Font: TTFThe font’s TrueType® font file ID. TrueType fonts can be used in all major browsers except for the Microsoft Internet Explorer® browser.
  • Font: EOTThe font’s Embedded OpenType Font file ID. EOT fonts are served exclusively to Internet Explorer browsers.
  • Font: WOFFThe font’s Web Open Font Format file ID. It is compatible with Firefox 3.6 and up. The WOFF file format is expected to eventually be compatible with all major browsers.
  • Font: SVGThe font’s Scalable Vector Graphics font file ID. This format is compatible with Apple iPhone, iPad and iPod touch devices.
  • Font: EnableSubsettingIndicates that a font should be dynamically subsetted in the website. Fonts with very large characters sets such as fonts support Chinese, Japanese and Korean writing systems can also have very large file sizes. Because it may take a long time to download a large file, fonts supporting these languages will be marked as EnableSubsetted fonts. The value will be either T for true or F for False.
  • TotalRecordsTotal number of records
  • PageStartstarting record requested (zero-based)
  • PageLimit# of records requested

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

$my_project_name = '[project name]';
$projectKey = $services->getProjectKeyByName($my_project_name);
$services->setProjectKey($projectKey);

$services->setAutoPublish(1); // do not auto publish

var_dump($services->removeFont(693796));



?>     

C#

    private string DeleteFont(string fontId, string projectId,int publish, int pageStart = 0, int pageLimit = 10)
    {

      const string method = "DELETE";
      string requestUri = "/rest/" + Format+ "/Fonts/" + 
                                             "?wfspid=" + projectId + 
                                             "&wfsfid=" + fontId +
                                             "&wfsnopublish=" + publish +
                                             "&wfspstart=" + pageStart + 
                                             "&wfsplimit=" + pageLimit;

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

    }       

VB.NET

  Private Function DeleteFont(ByVal fontId As String, ByVal projectId As String, ByVal publish As Integer, Optional ByVal pageStart As Integer = 0, Optional pageLimit As Integer = 10) As String

    Const method As String = "DELETE"
    Dim requestUri As String = "/rest/" & Format & "/Fonts/" & _
                               "?wfspid=" & projectId & _
                               "&wfsfid=" & fontId & _
                               "&wfsnopublish=" & publish & _
                               "&wfspstart=" & pageStart & _
                               "&wfsplimit=" & pageLimit

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

  End Function       

XML Response

<Fonts>
  <ProjectID>7bff9927-7964-4f6f-a132-adcae35ad51f</ProjectID>
  <Message>Success</Message>
  <Font>
    <FontID>717698</FontID>
    <FontName>Haarlem Black</FontName>
    <FontPreviewTextLong>Quick Brown Fox Jumped Over The Lazy Dog</FontPreviewTextLong>
    <FontFondryName>Monotype Imaging</FontFondryName>
    <FontCSSName>Haarlem W01 Black</FontCSSName>
    <FontLanguage></FontLanguage>
    <FontSize></FontSize>
    <CDNKey>d44f19a684109620e484147daf90e818082784eafd613082f04a2901e2fc90e07abf26e09077eeb422c4d34d256883d0</CDNKey>
    <TTF>13425481-9ba7-47e0-ac3f-535bd4202000</TTF>
    <EOT>eda0fd50-d523-418c-adfa-eafb47aaa57a</EOT>
    <SVG>a4543614-4294-43bc-8480-ae21661ce4cf</SVG>
    <WOFF>4fbcbe0b-8c97-4ce2-8bff-419f957a8981</WOFF>
    <EnableSubsetting>false</EnableSubsetting>
  </Font>
  <TotalRecords>1</TotalRecords>
  <PageStart>0</PageStart>
  <PageLimit>10</PageLimit>
</Fonts>

json Response

{
   "Fonts":{
      "Font":{
         "CDNKey":"d44f19a684109620e484147daf90e818082784eafd613082f04a2901e2fc90e07abf26e09077eeb422c4d34d256883d0",
         "EnableSubsetting":"false",
         "EOT":"eda0fd50-d523-418c-adfa-eafb47aaa57a",
         "FontCSSName":"Haarlem W01 Black",
         "FontFondryName":"Monotype Imaging",
         "FontID":"717698",
         "FontLanguage":null,
         "FontName":"Haarlem Black",
         "FontPreviewTextLong":"Quick Brown Fox Jumped Over The Lazy Dog",
         "FontSize":null,
         "SVG":"a4543614-4294-43bc-8480-ae21661ce4cf",
         "TTF":"13425481-9ba7-47e0-ac3f-535bd4202000",
         "WOFF":"4fbcbe0b-8c97-4ce2-8bff-419f957a8981"
      },
      "Message":"Success",
      "PageLimit":"10",
      "PageStart":"0",
      "ProjectID":"7bff9927-7964-4f6f-a132-adcae35ad51f",
      "TotalRecords":"1"
   }
}