Methods All
view-source14x14.png


Here's a compilation of officially available Wikidot XML-RPC API methods information and documentation:

Below you should find a more detailed documentation of how the methods work with Python.

Arguments and Results

With the exception of the system.*() methods,

  • each method takes exactly one argument: a dictionary with key/value pairs specific to each method, and

  • each method — if successful — will either return a list of dictionaries, or just a single dictionary, as its result — again with key/value pairs specific for each method.

Technical notes:

  • Many, maybe even all, methods seem to accept a common set of key/value pairs (user, performer, site, category, page, tags, source, title, parent_page, …) even though each method requires only a subset of those pairs. Any superfluous pair is validated (e. g. page.get() will validate that a category-name specified with {'category': category-name} exists), but then simply ignored.
  • The return data for page.save and user.valid needs to be validated; it may not be a dictionary or a list of dictionaries.

Available Methods

system.listMethods() can be used to list all available methods. As of 1240160400|today|agohover those methods are:

  • system.listMethods()
  • system.methodHelp()
  • system.methodSignature()
  • system.multicall()

Over time additional methods may be added.

For more details about the system.* methods (e. g. system.listMethods(), system.multicall()) see ServerProxy documentation.

Purpose

Method page.files() retrieves meta data about all attached files, e. g. name, URL, file size, when uploaded, MIME type, description and comment.

Syntax

page.files({'site': 'site-name', 'page': 'page-name'})

Arguments

site-name
the name of the site, from which information about files attached to page-name should be retrieved
page-name
the unix name (including its category) of the page for which information about attached pages should be retrieved

Returns

Meta data about files attached to the page is returned as a list of dictionaries with the following keys:

'name'
the file name including extension
'url'
The full URL http://site-name.wikidot.com/local--files/page-name/file-name
'size'
the file size as listed in the file's File Information pop-up
'date-added'
the file's upload date as listed in the file's File Information pop-up
'mime'
the file's MIME type as listed in the file's File Information pop-up
'description'
the content type as listed in the file's File Information pop-up
'comment'
Any comment that has been specified as “File comment:” during upload; otherwise a null string ('')

Note that the files are returned in an arbitrary order. To sort the returned list, see the Sort Returned Data snippet.

Example

The example assumes that s is a successfully authenticated ServerProxy object.

What you type … What you get …

s.page.files({'site': 'xml-api', 'page': 'doc:scripts'})

[{'comment': '',
  'name': 'api_pages_csv.py',
  'url': 'http://xml-api.wikidot.com/local--files/doc:scripts/api_pages_csv.py',
  'mime': 'text/x-java; charset=us-ascii',
  'date_added': '2009-04-16T22:06:01+00:00',
  'size': '3155',
  'description': 'ASCII Java program text, with CRLF line terminators'}
]

Purpose

Method page.get() retrieves a page's

  • content (both Wikidot syntax and HTML) and
  • meta data like page title, parent page, when created/edited, and attached tags.

Syntax

page.get({'site': 'site-name', 'page': 'page-name'})

Arguments

site-name
the name of the site, from which a page should be retrieved
page-name
the unix name (including its category) of the page to be be retrieved

Returns

The page's content together with some meta data is returned as a dictionary with the following keys:

'source'
the page's Wikidot markup
'html'
the page's HTML representation
'meta'
a dictionary of the following page meta data. Note that the value of the 'meta' key is equivalent to the structure of the dictionaries that site.pages() returns a list of.
'site'
the site's name the page is from
'category'
the page's category
'name'
the page name (without the category)
'full_name'
equal to 'name' if 'category' is _default, 'category':'name' otherwise
'title'
the page title as defined by the user
'title_shown'
the page title as displayed, including any autonumbering pattern
'title_or_unix_name'
the page title ('title') if not empty, the unix name ('name') with first letter capitalized and dashes replaced by blanks otherwise
'parent_page'
the page's parent page; None if no parent page has been set
'user_created'
the name of the user who created the page
'date_created'
date and time when the page was created; format YYYY-MM-DDThh:mm:ss+timezone1
'user_edited'
the name of the user who last edited the page; None if the page is at revision 0
'date_edited'
date and time when the page was last edited; the 'date_created' date/time if the page is at revision 0; format YYYY-MM-DDThh:mm:ss+timezone2
'tag_array'
a list of tags the page is tagged with
'tag_string'
a string of blank-separated tags the page is tagged with

Example

The example assumes that s is a successfully authenticated ServerProxy object.

What you type … What you get …

s.page.get({'site': 'community', 'page': 'admin:manage'})

{'source': '[[module ManageSite ]]\n\n[!-- \nPlease do not modify this page.\n--]',
 'html': '',
 'meta':
 {'category': 'admin',
  'user_edited': None,
  'tag_array': [],
  'name': 'manage',
  'title': 'Manage Site',
  'tag_string': '',
  'title_shown': 'Manage Site',
  'site': 'community',
  'title_or_unix_name': 'Manage Site',
  'parent_page': None,
  'full_name': 'admin:manage',
  'user_created': 'michal frackowiak',
  'date_created': '2006-08-01T01:35:46+00:00',
  'date_edited': '2006-08-01T01:35:46+00:00'
 }
}

Purpose

Method page.save() saves (changes) any or all of the following data to a page:

  • page source (Wikidot syntax),
  • page title,
  • the parent page's name, and/or
  • the page tags.

As of 1241776860|today|agohover method page.save() is not yet enabled; it can be called, but it does nothing.

For more information see Piotr's API page.save blog.

All information presented here — syntax, arguments, return data — has to be verified.

Syntax

page.save(
{'site': 'site-name', 'page': 'page-name'
<, 'source': 'wikidot-source'>
<, 'title': 'page-title'>
<, 'parent_page': 'parent-page-name'>
<, 'tags': [tag-1 <, tag-2 <, …> > ]>
<, 'tags': 'tag-string'>
})

where “<>” denote optional arguments.

Arguments

site-name
the name of the site to which the page belongs
page-name
the name of the page to save; either of the form category:page, or, page if the page is in the default category
wikidot-source
the new Wikidot source that the page should be changed to
page-title
the new page title to be set
parent-page-name
the name of the new parent page to be set
tag-x
a list of new tags to be set
tag-string
a string of new tags to be set

Returns

Currently None is returned — this may be due to the fact that page.save() has not been enabled yet.

Purpose

Method site.categories() retrieves the names of all categories in a site.

Syntax

site.categories({'site': 'site-name'})

Arguments

site-name
the name of the site, whose categories to list

Returns

All categories defined on http://site-name.wikidot.com are returned as a list of dictionaries with the following key:

'name'
The category's name; '_default' for the default category

Note that the categories are returned in an arbitrary order. To sort the returned list, see the Sort Returned Data snippet.

Example

The example assumes that s is a successfully authenticated ServerProxy object.

What you type … What you get …

s.site.categories({'site': 'xml-api'})

[{'name': 'doc'},
{'name': 'admin'},
{'name': '_default'},
{'name': 'search'},
{'name': 'system'},
{'name': 'nav'}]

Purpose

Method site.pages() retrieves meta data for all pages in a site or in a site's category, like page title, parent page, when created/edited, and attached tags.

Syntax

site.pages({'site': 'site-name' <, 'category': 'category-name'> })

where “<>” denote an optional argument.

Arguments

site-name
the name of the site, whose pages to list
category-name (optional)
the name of the category, which pages to list

Returns

Page meta data for all the pages in a site or a category is returned as a list of dictionaries with the following keys.

'site'
the site's name the page is from
'category'
the page's category
'name'
the page name (without the category)
'full_name'
equal to 'name' if 'category' is _default, 'category':'name' otherwise
'title'
the page title as defined by the user
'title_shown'
the page title as displayed, including any autonumbering pattern
'title_or_unix_name'
the page title ('title') if not empty, the unix name ('name') with first letter capitalized and dashes replaced by blanks otherwise
'parent_page'
the page's parent page; None if no parent page has been set
'user_created'
the name of the user who created the page
'date_created'
date and time when the page was created; format YYYY-MM-DDThh:mm:ss+timezone3
'user_edited'
the name of the user who last edited the page; None if the page is at revision 0
'date_edited'
date and time when the page was last edited; the 'date_created' date/time if the page is at revision 0; format YYYY-MM-DDThh:mm:ss+timezone4
'tag_array'
a list of tags the page is tagged with
'tag_string'
a string of blank-separated tags the page is tagged with

Note that the returned data is the same data as returned in the 'meta' dictionary item in the list of dictionaries returned by page.get().

The pages are returned in an arbitrary order. To sort the returned list, see the Sort Returned Data snippet.

Example

The example assumes that s is a successfully authenticated ServerProxy object.

What you type … What you get …

s.site.pages({'site':'xml-api', 'category': 'doc'})

[{'category': 'doc',
  'user_edited': None,
  'tag_array': [],
  'name': 'methods',
  'title': 'Methods',
  'tag_string': '',
  'title_shown': 'Methods',
  'site': 'xml-api',
  'title_or_unix_name': 'Methods',
  'parent_page': None,
  'full_name': 'doc:methods',
  'user_created': 'ErichSteinboeck',
  'date_created': '2009-04-09T11:25:30+00:00',
  'date_edited': '2009-04-11T19:48:45+00:00'
 },
 {'category': 'doc',
  'user_edited': None,
  'tag_array': [],
  'name': 'serverproxy',
  'title': 'ServerProxy',
  'tag_string': '',
  'title_shown': 'ServerProxy',
  'site': 'xml-api',
  'title_or_unix_name': 'ServerProxy',
  'parent_page': None,
  'full_name': 'doc:serverproxy',
  'user_created': 'ErichSteinboeck',
  'date_created': '2009-04-11T19:16:22+00:00',
  'date_edited': '2009-04-11T19:47:35+00:00'
 }
]

Purpose

Method user.sites() retrieves meta data for all sites a user is member of, like name, title, and private flag.

Syntax

user.sites({'user': 'user-name'})

Arguments

user-name
must be the name of the user you have authenticated with

Returns

All sites that user-name is a member of are returned as a list of dictionaries with the following keys:

'name'
The site-name part in the URL http://site-name.wikidot.com
'private'
true if the site is private, false otherwise
'title'
The site's title as it can be found in the Site Manager's General Settings under “Site name”

Note that the sites are returned in an arbitrary order. To sort the returned list, see the Sort Returned Data snippet.

Remarks

The API will only allow you to list the authenticated user's sites. In contrast, you may list all sites that any specific users is a member of, click on the Link “Member of” on that user's profile page http://www.wikidot.com/user:info/user-name.

Example

The example assumes that s is a successfully authenticated ServerProxy object.

What you type … What you get …

print s.user.sites({'user': 'user-name'})

[{'name': 'community', 'private': False,
  'title': 'Wikidot.com Community Portal'},
{'name': 'xml-api', 'private': False,
  'title': 'Wikidot XML RPC-API'}]

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License