This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// This sample script performs a query on world.silkapp.com and outputs the results on a map | |
// Live example on: http://silktool.com/map-example.php | |
// | |
// function to post an http request | |
function doPost ($url, $payload){ | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_POST, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- bar chart --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- page structure showing the title (line 7) and subtitle (line 8) --> | |
<article> | |
<section class="body"> | |
<div class="layout meta"> <!-- left column --> | |
<div class="block header text" data-component-uri="http://silkapp.com/component/block/text"> | |
<h1>Title</h1> | |
<p>Subtitle</p> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get the taglist of a site | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/taglist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- a tag in Silk using the data-tag-uri attribute --> | |
John is <a data-tag-uri="http://yoursite.silkapp.com/tag/age">46</a> years old. | |
<!-- to add a category to a page, use the data-tag-context attribute --> | |
<!-- this page has as title "John Doe" and it has the category "person" --> | |
<article data-tag-context="http://yoursite.silkapp.com/tag/person" data-title="John Doe">...</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create new page (or adjust existing page) called 'test' | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/page/test | |
-d '<article>...</article>' | |
-b 'silk_sid=...' | |
-X PUT | |
-H 'Content-Type: application/xml' |