APIs

From Redazione
Jump to navigation Jump to search

While you are establishing your organization's page structure at an address like the following

https://culturaitaliana.org/wiki/Prestissimo_(Spain)

that is structuring all your information optionally using semantic data through this wiki platform, you can start querying your pages (or even all your site) through the following set of APIs, for instance in order to display them in your wordpress site, or in whatever third party site written in any computer language.

The following endpoints do not directly query the standard mediawiki APIs, but an extended APIs built on top of the mediawiki APIs (called autonomously by an internal script which keeps updated all the information) providing additional data, like the detected language for each page, all the semantic data related to each page, the "title structure" (to allow the use of slashes within the title itself, ensuring at the same time the coherence of the hierarchical structure) and more.


Basically, through the following APIs you can query all the information of the created pages or a specific "folder" within it (also retrieving a structured index which can be easily used to create navigation menus, and of course, their html content) without dealing with the complexity and lack of immediacy of the standard mediawiki api, which would require multiple calls and further elaboration to reach that result.


wikipages

The following endpoint retrieves one or more wiki pages under a specific path. If included among the options, the endpoint returns a structured index (either partial, or of the entire site). Optional data for each page include all existing semantic properties, and the detected language.

Example of a GET request https://culturaitaliana.org/api/wikipages?title=Istituto_cultura_italiana_(NGO)&options=data%7Corganization_information%7Cindex%7Cexclude_hidden

The request queries all the webpages of the organization 'Istituto cultura italiana (NGO)', returns all data of each page, the structured index related to each page of the organization, and will exclude all hidden pages (that is pages unselected in the Frontend Index.

Response example


Parameters

keys values notes
title the page title (must include all the path and can be a parent page)
options index|complete_index|data|organization_information
path only required for private wikis, the private wiki username requires a POST request
username only required for private wikis, a username with sysop privileges requires a POST request
password only required for private wikis, the password of related username requires a POST request