API Documentation for pbworks.com

API v2 is still in development. We welcome suggestions and questions at api@pbworks.com. Be sure to check out the PBworks API mailing list.

Example API key table

v2 API keys should be kept as secret as any other password.
NameValueDescription
admin_key***************************v2 API admin key
write_key***************************v2 API write key
read_key***************************v2 API read key

Antispoofing inputs

In order to prevent third party from creating urls which would point someone logged in as an admin toward a link crafted to, for example delete a given page or append malicious text/scripts to a public page, we require a piece of identifying data which a third party would not know - the value of the user's session cookie. PBworks uses a cookie called 'ws' (domain = {wiki}.pbworks.com) for individual workspace logins.

When using credentials other than a workspace API key, this extra info is required. You need to send us the session cookie value as a cookie AND as a GET or POST paramater) for operations which change the state of a workspace, for example SetPageFolder.

Permanent cachability inputs

If you know the timestamp of the most recent change to a workspace's pages, you can be assured that a listing of pages fetched at that time will be as correct now as it was when you first fetched that list. To take advantage of this principle, you can add the specified timestamps to the request parameters for specified operations. If all of the 'permanent cachability inputs' are defined and are correct at the time of your request, PBworks will add headers to the HTTP response which will ensure permanent cachability by browsers and intermediate caches (if appropriate, depending on the workspace's privacy settings).

In practice, you can call the API function GetTimes to get the last change to the associated workspace state. Adding the pagetime timestamp, for example, to a GetPages request, will trigger permanent cachability for the response (if no errors are encountered). It is the caller's responsibilty to use this mechanism correctly -- i.e. adding a timestamp which is not returned by GetTimes will result in unexpected results an in particular will result in 'Cache-control: no-cache' header since the input is based on one or more incorrect assumptions.

Note that using the timestamp mechanism in this way is a performance enhancement, not a functional parameter of the API. It does not work retroactively -- that is, adding a pagetime timestamp which is the actual pagetime value minus some offset will result in a response which reflects the current state of the workspace, not at the time defined by that past timestamp.

Special inputs

Special optional inputs
NameTypeDescription
_dryrunint[1]Do a dry run, without actually performing the specified operation. Useful for checking credentials.
_after_successstringurl to redirect to following successful completion of the request (relative url only)
_after_errorstringurl to redirect if an error is encountered during request lifecycle (relative url only)
_typestringMarshall output as one of {"jsonenc" (application/json), "text" (text/plain), "jsontext" (text/plain), "html" (text/html), "php" (text/plain), "xml" (text/plain)}, "jsembed" (application/javascript), "csv" (application/vnd.ms-excel), "serialize" (text/plain),