API page.save
rating: +2+x

1241728343|%e %B %Y

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'] })

Notes:

  • 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

Comments

Question: does this work with my API-key ?
Helmuti_pdorfHelmuti_pdorf 1241780317|%e %b %Y, %H:%M %Z|agohover

Which I got some time before?
Or do I need a new one ?

And: a great Step forward !


Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.

Wollen Sie Wikidot helfen im deutschen » Wikidot Handbuch ?

Unfold Question: does this work with my API-key ? by Helmuti_pdorfHelmuti_pdorf, 1241780317|%e %b %Y, %H:%M %Z|agohover
Re: Helmuti
GabrysGabrys 1241788327|%e %b %Y, %H:%M %Z|agohover

The page.save method is being worked on, we haven't made it public yet (even for API-testers).


Piotr Gabryjeluk, Wikidot Inc.
visit my blog

Unfold Re: Helmuti by GabrysGabrys, 1241788327|%e %b %Y, %H:%M %Z|agohover
Re: Re: Helmuti
Helmuti_pdorfHelmuti_pdorf 1241939651|%e %b %Y, %H:%M %Z|agohover

Thanks Piotr, that makes it clear. :)

Confusing is the fact that there are 2 info-platforms about his theme - your blog with informations about your projects and loved work and the "official" ( means public) documentation about the API.
I think I forget this from time to time..


Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.

Wollen Sie Wikidot helfen im deutschen » Wikidot Handbuch ?

Unfold Re: Re: Helmuti by Helmuti_pdorfHelmuti_pdorf, 1241939651|%e %b %Y, %H:%M %Z|agohover
Re: Re: Helmuti
GabrysGabrys 1241942873|%e %b %Y, %H:%M %Z|agohover

Confusing is the fact that there are 2 info-platforms about his theme - your blog with informations about your projects and loved work and the "official" ( means public) documentation about the API.
I think I forget this from time to time..

There are two sources, but this is perfectly OK. Documentation (even not final yet) is official and informs about the current state of API. My blog informs about progress (and through older posts about history of it). I think this is good to have it done this way.

Cheers!


Piotr Gabryjeluk, Wikidot Inc.
visit my blog

Unfold Re: Re: Helmuti by GabrysGabrys, 1241942873|%e %b %Y, %H:%M %Z|agohover
Is there a expected release date?
IacopoIacopo 1244033993|%e %b %Y, %H:%M %Z|agohover

For the Wikidot API page.save method I mean.
Thanks for all!

Unfold Is there a expected release date? by IacopoIacopo, 1244033993|%e %b %Y, %H:%M %Z|agohover
Add a New Comment

Blog Author

386ba7d.jpg

My name is Piotr Gabryjeluk.

I study at Nicolaus Copernicus University in Toruń, Poland.
I work for Wikidot Inc as a web architect, developer and designer.

I have my own About page here.

Page tags: api dev wikidot xmlrpc
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License