Created
November 15, 2012 15:34
-
-
Save rutgervanwaveren/4079215 to your computer and use it in GitHub Desktop.
Silk API
This file contains hidden or 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' |
This file contains hidden or 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
$ curl https://api.silkapp.com/v1.4.0/site/uri/world.silkapp.com/query | |
-d 'from all documents where http://world.silkapp.com/tag/Population%20Growth | |
and (document has type http://world.silkapp.com/tag/Country) | |
and http://world.silkapp.com/tag/Population%20Growth less than "0" | |
select | |
document name | |
and http://world.silkapp.com/tag/Population%20Growth' | |
-X POST |
This file contains hidden or 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 information about a site for a specific user | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/world.silkapp.com/ | |
-b 'silk_sid=...' | |
# Update the name or description of a site | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/ | |
-b 'silk_sid=...' | |
-d '<site><name>The name</name><description>The description</description></site>' | |
-X PUT | |
-H 'Content-type: application/xml' |
This file contains hidden or 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 page 'Ghana' from the site world.silkapp.com | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/world.silkapp.com/page/Ghana | |
This file contains hidden or 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 information about the site world.silkapp.com in XML (default response) | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/world.silkapp.com/ | |
# Get information about the site world.silkapp.com in JSON | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/world.silkapp.com/?type=json |
This file contains hidden or 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 for a public site | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/taglist | |
# Get the taglist for a public or private site (with authentication) | |
$ curl https://api.silkapp.com/v1.4.0/site/uri/yoursite.silkapp.com/taglist | |
-b 'silk_sid=...' |
This file contains hidden or 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 information about the current user | |
$ curl https://api.silkapp.com/v1.4.0/user/current | |
-b 'silk_sid=...' | |
# get permissions for the current user | |
$ curl https://api.silkapp.com/v1.4.0/user/current/permission | |
-b 'silk_sid=...' |
This file contains hidden or 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
# Log in | |
$ curl https://api.silkapp.com/v1.4.0/user/signin | |
-d "<signin><email>yourEmail</email><password>yourPassword</password></signin>" | |
-H "Content-Type: application/xml" | |
-X POST | |
-i |
This file contains hidden or 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
<!-- XML response from /permissions for a public site --> | |
<list> | |
... | |
<permission> | |
<account> | |
<anonymous/> | |
</account> | |
<repository>yoursite.silkapp.com</repository> | |
<canRead>true</canRead> | |
<canWrite>false</canWrite> | |
<isAdmin>false</isAdmin> | |
</permission> | |
... | |
</list> |
This file contains hidden or 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
<!-- XML response from /permissions for a site that can be edited by every logged in user --> | |
<list> | |
... | |
<permission> | |
<account> | |
<authenticated/> | |
</account> | |
<repository>yoursite.silkapp.com</repository> | |
<canRead>true</canRead> | |
<canWrite>true</canWrite> | |
<isAdmin>false</isAdmin> | |
</permission> | |
... | |
</list> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment