API page.save

07 May 2009 20:32

The Wikidot API page.save method is one of the things we've been holding over for weeks, just because there were so many other important things to do.

But the API is also important, because it can enable developers (which are big fraction of our users) to create applications that use Wikidot.com as a service. This can be useful in many ways, the best example I can think of is creating an application, that get some photos from your disk, uploads them to Wikidot, creates a page for each of them and saves some metadata from them into it.

Today, I finally managed to start working on one of the most important API method which is page.save. This method obviously is for saving a page. The page saving mechanism in Wikidot is quite complex, because of advanced site permissions, various performance optimizations, caches and many scenarios of updating a page.

Also, we wanted to make page.save to be one method to update and create pages, which involves other permission checking, because in some cases you have permission to create a page, but not to edit. This is especially true if you have a site category with everybody-can-create-but-only-author-can-edit policy.

I started from dealing with updating already existing pages, so for now page.save can't yet create pages. We have more or less working page.save for the following activities:

code in Python syntax
set title page.save({ 'site': 'quake', 'page': 'dev:api-save', 'title': 'Other title' })
update page source page.save({ 'site': 'quake', 'page': 'dev:api-save', 'source': '+ Come back later' })
set tags page.save({ 'site': 'quake', 'page': 'dev:api-save', 'tags': ['wikidot', 'api'] })
all at once page.save({ 'site': 'quake', 'page': 'dev:api-save', 'title': 'Other title', 'source': '+ Come back later', 'tags': ['wikidot', 'api'] })


  • the API service is XML-RPC based, so the syntax of calls is syntax of the programming language you use (Python used as an example syntax)
  • site: quake and page: dev:api-save means http://quake.wikidot.com/dev:api-save page
  • setting tags as a single string (comma- or space-separated) is also supported
  • setting of parent page is also supported in similar way to setting the title

Now we're going to review the code, ensure there is no more caching mechanism I forgot about and make final polishing. This includes generating notifications to be send to page-watchers and saving revision comments.

This method is crucial for the API. Once it gets fully working (including creating pages), applications will be able to:

  • create pages
  • read pages
  • modify pages

and this the core functionality we want to provide with the Wikidot API.

Check out the API methods to see if page.save is already out.

If you want to test the (beta) API, drop a comment at the Wikidot API page.

Next post: Wymiatacz

More posts on this topic


Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License