URL
http://api.fonts.com/rest/{format}/ProjectStylesImport/
http://api.fonts.com/rest/{format}/ProjectStylesImport/
xml or json
GET
<?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 = $wfs->getProjectKeyByName($my_project_name);
$services->setProjectKey($projectKey);
$result = $services->importStylesheet($stylesheetToken);
var_dump($result);
$sids = array();
foreach($result['ProjectStyle'] as $style){
$sids[] = $style['SelectorID'];
}
$selectors = implode(',', $sids);
?>
private string ProjectStylesImport(string projectToken, string projectId, int pageStart, int pageLimit)
{
const string method = "GET";
string requestUri = "/rest/" + Format + "/ProjectStylesImport/" +
"?wfspid=" + projectId +
"&wfsptoken=" + projectToken +
"&wfspstart=" + pageStart +
"&wfsplimit=" + pageLimit;
//See common functions for GetResponse
return GetResponse(method, requestUri);
}
Private Function ProjectStylesImport(ByVal projectToken As String, ByVal projectId As String, ByVal pageStart As Integer, ByVal pageLimit As Integer) As String
Const method As String = "GET"
Dim requestUri As String = "/rest/" & Format & "/ProjectStylesImport/" & _
"?wfspid=" & projectId & _
"&wfsptoken=" & projectToken & _
"&wfspstart=" & pageStart & _
"&wfsplimit=" & pageLimit
'See common functions for GetResponse
Return GetResponse(method, requestUri)
End Function
<ProjectStyles>
<ProjectID>7bff9927-7964-4f6f-a132-adcae35ad51f</ProjectID>
<Message>Success</Message>
<ProjectStyle>
<SelectorID>3ff4c957-65fd-428d-a53b-3892da0b1960</SelectorID>
<SelectorTag>h1</SelectorTag>
<FontID>691782</FontID>
<FontName>Albertusr Regular</FontName>
<FontPreviewTextLong>Quick Brown Fox Jumped Over The Lazy Dog</FontPreviewTextLong>
<FontFondryName>Monotype Imaging</FontFondryName>
<FontCSSName>Albertus W01</FontCSSName>
<FontLanguage></FontLanguage>
<FontSize></FontSize>
<CDNKey>d44f19a684109620e484147daf90e818082784eafd613082f04a2901e2fc90e07abf26e09077eeb422c4d34d256883d0</CDNKey>
<TTF>9a98ab49-8706-4ba0-9de9-8de54c96bb4c</TTF>
<EOT>39b01d2e-3d63-415e-aaae-408baea01666</EOT>
<SVG>bda30cf7-8011-486d-81f5-d73a7d32e658</SVG>
<WOFF>6605b509-e47b-45a6-8823-67b43b7e594c</WOFF>
<EnableSubsetting>false</EnableSubsetting>
</ProjectStyle>
<TotalRecords>1</TotalRecords>
<PageStart>0</PageStart>
<PageLimit>10</PageLimit>
</ProjectStyles>
{
"ProjectStyles":{
"Message":"Success",
"PageLimit":"10",
"PageStart":"0",
"ProjectID":"7bff9927-7964-4f6f-a132-adcae35ad51f",
"ProjectStyle":{
"CDNKey":"d44f19a684109620e484147daf90e818082784eafd613082f04a2901e2fc90e07abf26e09077eeb422c4d34d256883d0",
"EnableSubsetting":"false",
"EOT":"39b01d2e-3d63-415e-aaae-408baea01666",
"FontCSSName":"Albertus W01",
"FontFondryName":"Monotype Imaging",
"FontID":"691782",
"FontLanguage":null,
"FontName":"Albertusr Regular",
"FontPreviewTextLong":"Quick Brown Fox Jumped Over The Lazy Dog",
"FontSize":null,
"SelectorID":"3ff4c957-65fd-428d-a53b-3892da0b1960",
"SelectorTag":"h1",
"SVG":"bda30cf7-8011-486d-81f5-d73a7d32e658",
"TTF":"9a98ab49-8706-4ba0-9de9-8de54c96bb4c",
"WOFF":"6605b509-e47b-45a6-8823-67b43b7e594c"
},
"TotalRecords":"1"
}
}