The Paspartout API is meant for developers or Paspartout site owners who want to create widgets, use public Paspartout data externally or extend behavior.
To get started get the API key of the site you want to approach. It can be found in the admin under settings > paspartout api. It looks like this:
ppt-123456789 |
Note that the length of the key may vary from site to site.
To get your site with its homepage in XML format:
http://api.paspartout.com/public/v2/ppt-123456789.xml |
The same is also available in JSON:
http://api.paspartout.com/public/v2/ppt-123456789.json |
To get the main pages of your site (e.g. blog, portfolio, about, ...):
http://api.paspartout.com/public/v2/ppt-123456789/pages.xml |
Or a single page:
http://api.paspartout.com/public/v2/ppt-123456789/pages/123.xml |
More detailed documentation will follow soon, so keep an eye on this page!
We prepared a JavaScript API wrapper. The library is framework agnostic and can be downloaded from github.
Here is a quick guide to get you started.
First include the library in your page:
<script src="paspartout.api.public.v2.js" type="text/javascript"></script> |
Then define the site api id of the site you want to approach:
Paspartout.config.siteId = 'ppt-123456789'; |
Next, you can load your site including its homepage:
1 2 3 4 5 6 7 8 |
Paspartout.Api.Site.load({
success: function(site) {
... your code ...
},
failure: function(error) {
console.error(error);
}
}); |
Or a given page (by id or permaname):
1 2 3 4 5 6 7 8 |
Paspartout.Api.Page.load(page_id_or_permaname, {
success: function(page) {
... your code ...
},
failure: function(error) {
console.error(error);
}
}); |
Read more on github.
If you are good at writing Ruby , Python , PHP or any another language and you feel like writing a library for Paspartout, go ahead and It will be very much appreciated.