Skip to content

Instantly share code, notes, and snippets.

@rutgervanwaveren
Created November 15, 2012 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rutgervanwaveren/4079620 to your computer and use it in GitHub Desktop.
Save rutgervanwaveren/4079620 to your computer and use it in GitHub Desktop.
Silk API (2)
<!-- 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>
<!-- a Silk document is valid XML within article tags -->
<article>
...
</article>
<!-- the basic structure of a document -->
<article>
<section class="body">
<div class="layout meta">.. this is the left column ..</div>
<div class="layout content">.. this is the right column ..</div>
</section>
</article>
# get the autosave for a particular page for a user
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/page/mypage/autosave
-b 'silk_sid=...'
# get the page called 'home' (the home page) from yoursite.silkapp.com
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/page/home
# for private sites add the silk_sid cookie for authentication
$ curl https://api.silkapp.com/v1.4.0/site/uri/site.silkapp.com/page/home
-b 'silk_sid=...'
# get list (max 100) of public sites with information about the creator, creation date and permissions
$ curl https://api.silkapp.com/v1.4.0/site
# get the next 100 public sites
$ curl https://api.silkapp.com/v1.4.0/site?offset=2
# get more or less results
$ curl https://api.silkapp.com/v1.4.0/site?count=20
# get a list of versions for a page
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/page/mypage/version
-b 'silk_sid=...'
# get list of users and their permissions for a site
$ curl https://api.silkapp.com/v1.4.0/site/uri/mysite.silkapp.com/permission
-b 'silk_sid=...'
# search for a site by name
$ curl https://api.silkapp.com/v1.4.0/site/search/<string>
# get information if a site is available to create
$ curl https://api.silkapp.com/v1.4.0/site/available
-d 'yoursite.silkapp.com'
-X POST
-H "Content-Type: text/plain"
# subscribe to email updates for changes to a site
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/subscription/current
-b 'silk_sid=...'
-d '"daily"'
-X PUT
-H "Content-Type:application/json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment