APIs

From Redazione
Jump to navigation Jump to search


Open access APIs

The following endpoints do not require any authentication and they can be queried by anyone.


wikipages

The following endpoint retrieves one or more wiki pages under a specific path. If set among the options, and more than one pages are captured, the endpoint returns a structured index. Optional data for each page include all existing semantic properties, and the detected language.


endpoint

	https://culturaitaliana.org/api/wikipages


urlencoded request (GET)

	path: String (path of relevant wiki),
	title: String (page title),
	organization_id: Integer (can be used instead of title, it is used to retrieve all the pages not belonging to an organization from the public wiki),
	options: index|data|organization_information|exclude_hidden (List of values. 'index': include a structured index; 'data': all data related to each page; 'organization_information': if the related wiki is public, and the retrieved page(s) belongs to an organization, returns organization's main data; 'exclude_hidden': exclude pages hidden from the index in the pages list
	'username':  String (username of bot or admin account, only for private wikis),
	'password':  String (username of bot or admin account, only for private wikis),


Authentication required APIs

The following endpoints involve confidential data and they require an authentication: typically, they can be used by any registered user in any wiki of this platform (either public or private) with sysop privileges. Just write at redazione@culturaitaliana.org if you want query them from your platform.


sendemail

The following endpoint allows to send an email message, using one of the templates available on the site, to arbitrary lists of recipients including users belonging to groups of the related mediawiki.

endpoint

	https://culturaitaliana.org/api/sendemail


json request (POST)

{
	'path': String (url of related wiki),
	'username': String (username of bot or admin account),
	'password': String (password of bot or admin account),

	'template': String (name of used "pug" template),
	'to' or Array: String (list of recipients, can include one or more wiki groups),
	'cc': String or Array (list of recipients, can include one or more wiki groups),
	'bcc': String or Array (list of recipients, can include one or more wiki groups),
	'locals': Object (keys to be interpolated with values in the related template),

}


sendcode

The following endpoint sends a pin code at the provided email address held by a given property name.

endpoint

	https://culturaitaliana.org/api/sendcode


json request (POST)

{
	'email': String (email address),
	'property':  String (semantic property holding the value)
}